Skip to content

Commit dc60410

Browse files
authored
fix(optimizer): trigger onCrawlEnd after manual included deps are registered (#18733)
1 parent ed99a2c commit dc60410

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/vite/src/node/optimizer/optimizer.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ export function createDepsOptimizer(
162162
cachedMetadata || initDepsOptimizerMetadata(environment, sessionTimestamp)
163163

164164
if (!cachedMetadata) {
165-
environment.waitForRequestsIdle().then(onCrawlEnd)
166165
waitingForCrawlEnd = true
167166

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

189+
environment.waitForRequestsIdle().then(onCrawlEnd)
190+
190191
if (noDiscovery) {
191192
// We don't need to scan for dependencies or wait for the static crawl to end
192193
// Run the first optimization run immediately

0 commit comments

Comments
 (0)