Skip to content

Commit

Permalink
refactor: remove unnecessary if conditions (#11668)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenfan0 committed Jan 12, 2023
1 parent 305b76e commit 9c114c5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/vite/src/node/optimizer/optimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,13 @@ async function createDepsOptimizer(
}
}

if (!isBuild) {
const knownDeps = prepareKnownDeps()

// For dev, we run the scanner and the first optimization
// run on the background, but we wait until crawling has ended
// to decide if we send this result to the browser or we need to
// do another optimize step
postScanOptimizationResult = runOptimizeDeps(config, knownDeps)
}
const knownDeps = prepareKnownDeps()

// For dev, we run the scanner and the first optimization
// run on the background, but we wait until crawling has ended
// to decide if we send this result to the browser or we need to
// do another optimize step
postScanOptimizationResult = runOptimizeDeps(config, knownDeps)
} catch (e) {
logger.error(e.message)
} finally {
Expand Down

0 comments on commit 9c114c5

Please sign in to comment.