Skip to content

Commit ea17612

Browse files
committed
wip: update
1 parent 9e5fe76 commit ea17612

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,19 @@ export class FullBundleDevEnvironment extends DevEnvironment {
107107
}
108108
},
109109
})
110-
this.devEngine.run().catch(() => {})
110+
debug?.('INITIAL: setup dev engine')
111+
this.devEngine.run().then(
112+
() => {
113+
debug?.('INITIAL: run done')
114+
},
115+
() => {
116+
debug?.('INITIAL: run error')
117+
},
118+
)
119+
this.devEngine.ensureCurrentBuildFinish().then(() => {
120+
debug?.('INITIAL: build done')
121+
this.hot.send({ type: 'full-reload', path: '*' })
122+
})
111123
}
112124

113125
override async warmupRequest(_url: string): Promise<void> {
@@ -152,14 +164,14 @@ export class FullBundleDevEnvironment extends DevEnvironment {
152164

153165
async triggerBundleRegenerationIfStale(): Promise<boolean> {
154166
const scheduled = await this.devEngine.scheduleBuildIfStale()
155-
if (scheduled) {
167+
if (scheduled === 'scheduled') {
156168
this.devEngine.ensureCurrentBuildFinish().then(() => {
157169
this.hot.send({ type: 'full-reload', path: '*' })
158170
this.logger.info(colors.green(`page reload`), { timestamp: true })
159171
})
160172
debug?.(`TRIGGER: access to stale bundle, triggered bundle re-generation`)
161173
}
162-
return scheduled
174+
return !!scheduled
163175
}
164176

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

0 commit comments

Comments
 (0)