MCPcopy
hub / github.com/vitejs/vite / notifyRebuildComplete

Function notifyRebuildComplete

playground/vitestSetup.ts:339–354  ·  view source on GitHub ↗
(
  watcher: RolldownWatcher,
)

Source from the content-addressed store, hash-verified

337 * Send the rebuild complete message in build watch
338 */
339export async function notifyRebuildComplete(
340 watcher: RolldownWatcher,
341): Promise<void> {
342 let resolveFn: undefined | (() => void)
343 const callback = (event: RolldownWatcherEvent): void => {
344 if (event.code === 'END') {
345 resolveFn?.()
346 }
347 }
348 watcher.on('event', callback)
349 await new Promise<void>((resolve) => {
350 resolveFn = resolve
351 })
352
353 watcher.off('event', callback)
354}
355
356export function createInMemoryLogger(logs: string[]): Logger {
357 const loggedErrors = new WeakSet<Error | RollupError>()

Callers 3

startDefaultServeFunction · 0.85
assets.spec.tsFile · 0.85

Calls 2

onMethod · 0.65
offMethod · 0.65

Tested by

no test coverage detected