Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ describeServeBuilder(executeDevServer, DEV_SERVER_BUILDER_INFO, (harness, setupT
expectNoLog(logs, 'Unexpected character "EOF"');
},
],
{ outputLogsOnFailure: false, timeout: 90_000 },
{ outputLogsOnFailure: false },
);
}, 120_000);
});
});
});
8 changes: 8 additions & 0 deletions packages/angular/build/src/tools/esbuild/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import type * as ParcelWatcher from '@parcel/watcher';
import type * as Chokidar from 'chokidar';
import { once } from 'node:events';
import * as fs from 'node:fs';
import * as path from 'node:path';
import picomatch from 'picomatch';
Expand Down Expand Up @@ -663,8 +664,15 @@ async function createChokidarWatcher(
usePolling: !!options?.polling,
interval: options?.interval,
});

const initTime = Date.now();

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

const handleEvent = (type: 'added' | 'modified' | 'removed', rawPath: string) => {
const posixPath = toPosixPathNormalized(rawPath);
const lookupKey = toLookupKey(posixPath, isCaseSensitive);
Expand Down
Loading