Skip to content

Commit

Permalink
chore(optimizer): remove redundant setTimeout call in scan process (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day committed Apr 3, 2023
1 parent 2efd3ec commit 0ce0e93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vite/src/node/optimizer/optimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ async function createDepsOptimizer(
if (!isBuild) {
// Important, the scanner is dev only
depsOptimizer.scanProcessing = new Promise((resolve) => {
// Ensure server listen is called before the scanner
setTimeout(async () => {
// Runs in the background in case blocking high priority tasks
;(async () => {
try {
debug(colors.green(`scanning for dependencies...`))

Expand Down Expand Up @@ -244,7 +244,7 @@ async function createDepsOptimizer(
resolve()
depsOptimizer.scanProcessing = undefined
}
}, 0)
})()
})
}
}
Expand Down

0 comments on commit 0ce0e93

Please sign in to comment.