Repository navigation
fix(@angular/build): recursively ignore output and cache paths in watch mode - #33812
Conversation
…ch mode When watching for file changes, @parcel/watcher and chokidar use glob matching against the ignored patterns. Passing exact directory paths without recursive glob wildcards (`/**`) fails to match nested output artifacts and cache files on disk. Additionally, unnormalized Windows path separators in directory paths prevent POSIX glob engines from matching. When directory watching or NG_BUILD_WATCH_ROOT is enabled, mutations inside the output directory (such as emitted bundles or deleted files during rebuild cleanup) were falsely detected as modified source files, triggering spurious rebuilds and causing race conditions on missing output files. Output and cache directory paths are now POSIX-normalized and configured with recursive glob patterns (`/**`) so all nested files and subdirectories are properly ignored by the watcher.
There was a problem hiding this comment.
Code Review
This pull request introduces changes to normalize and ignore output and cache paths during the build process, adding support for glob patterns in Chokidar's watcher using the picomatch library. A critical issue was identified in the watcher implementation where { path, recursive } objects are passed to Chokidar's ignored option, which is unsupported and will cause non-glob patterns to be silently ignored. A code suggestion has been provided to resolve this by returning a custom matching function instead.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When watching for file changes, @parcel/watcher and chokidar use glob matching against the ignored patterns. Passing exact directory paths without recursive glob wildcards (
/**) fails to match nested output artifacts and cache files on disk. Additionally, unnormalized Windows path separators in directory paths prevent POSIX glob engines from matching. When directory watching or NG_BUILD_WATCH_ROOT is enabled, mutations inside the output directory (such as emitted bundles or deleted files during rebuild cleanup) were falsely detected as modified source files, triggering spurious rebuilds and causing race conditions on missing output files.Output and cache directory paths are now POSIX-normalized and configured with recursive glob patterns (
/**) so all nested files and subdirectories are properly ignored by the watcher.