Skip to content

fix(@angular/build): inherit preserveSymlinks option from build target in unit-test builder#33452

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix-symlinked-imports-unit-test
Open

fix(@angular/build): inherit preserveSymlinks option from build target in unit-test builder#33452
clydin wants to merge 1 commit into
angular:mainfrom
clydin:fix-symlinked-imports-unit-test

Conversation

@clydin

@clydin clydin commented Jun 24, 2026

Copy link
Copy Markdown
Member

The unit-test builder did not pass the preserveSymlinks configuration to Vitest's custom configuration plugin and resolved it directly from buildTargetOptions in Karma executor without considering process arguments. This caused module resolution failures in unit tests for symlinked packages.

This change inherits preserveSymlinks from the referenced buildTarget options, falling back to process.execArgv if not defined. The resolved value is then successfully forwarded to the underlying bundlers and executors (Karma and Vitest).

…t in unit-test builder

The unit-test builder did not pass the preserveSymlinks configuration to Vitest's custom configuration plugin and resolved it directly from buildTargetOptions in Karma executor without considering process arguments. This caused module resolution failures in unit tests for symlinked packages.

This change inherits preserveSymlinks from the referenced buildTarget options, falling back to process.execArgv if not defined. The resolved value is then successfully forwarded to the underlying bundlers and executors (Karma and Vitest).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the preserveSymlinks option in the unit-test builder. It resolves the option from either the build target options or the process execution arguments, and propagates it to both the Karma and Vitest test runners, ensuring consistent symlink resolution behavior during testing. I have no feedback to provide as there are no review comments.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Jun 24, 2026
@clydin clydin requested a review from alan-agius4 June 24, 2026 20:23
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant