Skip to content

Commit

Permalink
fix: optimizer stall
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Nov 22, 2024
1 parent ab70cc1 commit 4a72e08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/optimizer/optimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ export function createDepsOptimizer(
cachedMetadata || initDepsOptimizerMetadata(environment, sessionTimestamp)

if (!cachedMetadata) {
environment.waitForRequestsIdle().then(onCrawlEnd)
waitingForCrawlEnd = true

// Enter processing state until crawl of static imports ends
Expand All @@ -187,6 +186,8 @@ export function createDepsOptimizer(
newDepsDiscovered = true
}

environment.waitForRequestsIdle().then(onCrawlEnd)

if (noDiscovery) {
// We don't need to scan for dependencies or wait for the static crawl to end
// Run the first optimization run immediately
Expand Down

0 comments on commit 4a72e08

Please sign in to comment.