Skip to content

Commit bef42fb

Browse files
committed
wip: update
1 parent ea17612 commit bef42fb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,19 @@ export class FullBundleDevEnvironment extends DevEnvironment {
116116
debug?.('INITIAL: run error')
117117
},
118118
)
119-
this.devEngine.ensureCurrentBuildFinish().then(() => {
119+
this.waitForInitialBuildFinish().then(() => {
120120
debug?.('INITIAL: build done')
121121
this.hot.send({ type: 'full-reload', path: '*' })
122122
})
123123
}
124124

125+
private async waitForInitialBuildFinish(): Promise<void> {
126+
while (this.memoryFiles.size === 0) {
127+
await this.devEngine.ensureCurrentBuildFinish()
128+
await new Promise((resolve) => setTimeout(resolve, 10))
129+
}
130+
}
131+
125132
override async warmupRequest(_url: string): Promise<void> {
126133
// no-op
127134
}

0 commit comments

Comments
 (0)