Skip to content

Commit ccfccef

Browse files
authored
fix: watch related fixes (#158)
1 parent 6e1d23e commit ccfccef

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/vite/src/node/build.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,7 @@ async function buildEnvironment(
860860
prepareOutDir(resolvedOutDirs, emptyOutDir, environment)
861861
}
862862
} else if (event.code === 'BUNDLE_END') {
863-
// FIXME: https://github.com/rolldown/rolldown/issues/4380
864-
// event.result.close()
863+
event.result.close()
865864
logger.info(colors.cyan(`built in ${event.duration}ms.`))
866865
} else if (event.code === 'ERROR') {
867866
outputBuildError(event.error)

playground/vitestSetup.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,14 @@ export async function notifyRebuildComplete(
303303
const callback = (event: RolldownWatcherEvent): void => {
304304
if (event.code === 'END') {
305305
resolveFn?.()
306-
resolveFn = undefined // set to undefined instead of watcher.off for now
307306
}
308307
}
309308
watcher.on('event', callback)
310309
await new Promise<void>((resolve) => {
311310
resolveFn = resolve
312311
})
313312

314-
// TODO: not supported yet (https://github.com/rolldown/rolldown/issues/4382)
315-
// return watcher.off('event', callback)
316-
return watcher
313+
return watcher.off('event', callback)
317314
}
318315

319316
export function createInMemoryLogger(logs: string[]): Logger {

0 commit comments

Comments
 (0)