Repository navigation
fix(@angular/build): ensure asset followSymlinks defaults to false - #34172
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces tests to verify the behavior of symlink directory resolution during builds, ensuring they are not followed by default but are followed when followSymlinks is enabled. It also updates asset resolution and copying utilities to cast entry.followSymlinks to a boolean. The feedback suggests replacing the double negation (!!) with the nullish coalescing operator (?? false) for improved readability and idiomatic TypeScript.
80d7dd6 to
26197db
Compare
When `followSymlinks` is omitted from an asset configuration entry, its value is `undefined`. Because `tinyglobby` treats `followSymbolicLinks: undefined` as `true`, symlinked subdirectories within asset folders were traversed even though the schema documents the default as `false`. Coerce `entry.followSymlinks` to a boolean (`entry.followSymlinks ?? false`) so the runtime behavior matches the documented schema default and the existing Webpack builder behavior. Closes angular#34164
26197db to
741387c
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. |
When
followSymlinksis omitted from an asset configuration entry, its value isundefined. BecausetinyglobbytreatsfollowSymbolicLinks: undefinedastrue, symlinked subdirectories within asset folders were traversed even though the schema documents the default asfalse.Coerce
entry.followSymlinksto a boolean (!!entry.followSymlinks) so the runtime behavior matches the documented schema default and the existing Webpack builder behavior.Closes #34164