( watcher: RolldownWatcher, )
| 337 | * Send the rebuild complete message in build watch |
| 338 | */ |
| 339 | export 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 | |
| 356 | export function createInMemoryLogger(logs: string[]): Logger { |
| 357 | const loggedErrors = new WeakSet<Error | RollupError>() |
no test coverage detected