Repository navigation
refactor(@angular/build): export NormalizedAssetsPattern and avoid mutating input patterns - #34354
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors asset pattern normalization by introducing a dedicated NormalizedAssetsPattern interface, simplifying the directory check logic, and cleaning up imports and JSDoc comments. It also streamlines tslib dependency resolution in library package manifests and adds tests for asset ignoring. Feedback highlights that the simplified statSync call with throwIfNoEntry: false could still throw on non-ENOENT errors (like permission issues), and recommends wrapping it in a try-catch block to ensure robustness.
384feda to
792654f
Compare
…tating input patterns
Export the `NormalizedAssetsPattern` interface from `normalize-asset-patterns.ts`, avoid mutating input `AssetPatternClass` objects in place, and simplify directory detection using `statSync(..., { throwIfNoEntry: false })`.
Also import `normalizeAssetPatterns` directly in `library/options.ts` and add test coverage for asset `ignore` patterns.
c4616df to
2809844
Compare
|
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. |
Export the
NormalizedAssetsPatterninterface fromnormalize-asset-patterns.ts, avoid mutating inputAssetPatternClassobjects in place, and simplify directory detection usingstatSync(..., { throwIfNoEntry: false }).Also import
normalizeAssetPatternsdirectly inlibrary/options.tsand add test coverage for assetignorepatterns.