File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/vite/src/node/server/environments Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff 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 > {
You can’t perform that action at this time.
0 commit comments