Skip to content

Commit ad6a6ca

Browse files
committed
fixup! fix(@angular/build): ensure chokidar watcher is ready before returning
1 parent f22bff9 commit ad6a6ca

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/angular/build/src/tools/esbuild

‎packages/angular/build/src/tools/esbuild/watcher.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,14 +665,14 @@ async function createChokidarWatcher(
665665
interval: options?.interval,
666666
});
667667

668+
const initTime = Date.now();
669+
668670
// Wait for the watcher to complete its initial filesystem scan before returning.
669671
// With `ignoreInitial: true`, any file visited during the initial scan is treated as the initial baseline
670672
// and will not emit 'add' or 'change' events. Awaiting 'ready' ensures that rapid file modifications
671673
// made right after watcher setup (e.g. in rebuild tests) are not swallowed as initial files.
672674
await once(watcher, 'ready');
673675

674-
const initTime = Date.now();
675-
676676
const handleEvent = (type: 'added' | 'modified' | 'removed', rawPath: string) => {
677677
const posixPath = toPosixPathNormalized(rawPath);
678678
const lookupKey = toLookupKey(posixPath, isCaseSensitive);

0 commit comments

Comments
 (0)