Repository navigation
fix(@angular/build): align library watch asset matching with initial build and deduplicate outputs - #34432
Merged
alan-agius4 merged 4 commits intoOct 21, 2026
Conversation
…build and deduplicate outputs - Respect `asset.followSymlinks` in watch mode by using `lstatSync` when `!asset.followSymlinks` and `statSync` when `asset.followSymlinks` is `true`. - Normalize `asset.glob` and `asset.ignore` patterns in `createAssetMatchers` to match `tinyglobby` semantics (stripping trailing slashes, expanding directory patterns with `/**`, normalizing POSIX paths, skipping empty strings, and passing `windows: false`). - Deduplicate collected and resolved assets by destination `path` so later asset configurations override earlier ones without concurrent `fs.cp` operations to the same output destination. - Queue nested emitted assets for deletion when a deleted parent directory is reported in watch mode.
alan-agius4
marked this pull request as ready for review
October 20, 2026 10:28
There was a problem hiding this comment.
Code Review
This pull request enhances asset handling in the Angular library builder by introducing a normalizeGlobPattern utility and updating createAssetMatchers and collectAssetsToEmit to improve support for symlinks and directory deletion tracking in watch mode. Comprehensive unit tests were added to verify these changes. A high-severity issue was identified in the normalizeGlobPattern function, where it incorrectly appends /** to file glob patterns; the reviewer provided a necessary fix using picomatch.isGlob to ensure correct matching behavior.
…nitial build and deduplicate outputs
…nitial build and deduplicate outputs
…nitial build and deduplicate outputs
clydin
approved these changes
Oct 21, 2026
Collaborator
Author
|
This PR was merged into the repository. The changes were merged into the following branches:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
asset.followSymlinksin watch mode (collectAssetsToEmit) by usinglstatSyncwhen!asset.followSymlinksandstatSyncwhenasset.followSymlinksistrue(cachingstatandlstatseparately per file).asset.globandasset.ignoreincreateAssetMatchersto matchtinyglobbysemantics on initial build (filtering empty strings, expanding directory patterns with/**, normalizing viaposix.normalize, and settingwindows: false).path(allowing later asset configurations to override earlier ones) to prevent concurrentfs.cpcalls to the same destination.