Skip to content

Commit 0c5af1a

Browse files
committed
wip: update
1 parent 764824d commit 0c5af1a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/vite/src/node/server/environments/fullBundleEnvironment.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,16 @@ export class FullBundleDevEnvironment extends DevEnvironment {
254254
}
255255

256256
async triggerBundleRegenerationIfStale(): Promise<boolean> {
257-
const hasLatestBuildOutput = await this.devEngine.hasLatestBuildOutput()
258-
if (!hasLatestBuildOutput) {
257+
const bundleState = await this.devEngine.getBundleState()
258+
const shouldTrigger =
259+
bundleState.hasStaleOutput && !bundleState.lastFullBuildFailed
260+
if (shouldTrigger) {
259261
this.devEngine.ensureLatestBuildOutput().then(() => {
260262
this.debouncedFullReload()
261263
})
262264
debug?.(`TRIGGER: access to stale bundle, triggered bundle re-generation`)
263265
}
264-
return !hasLatestBuildOutput
266+
return shouldTrigger
265267
}
266268

267269
override async close(): Promise<void> {

0 commit comments

Comments
 (0)