Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webpack): resolve assets from executor options as relative to workspace root #22544

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Mar 27, 2024

The previous fix to relative asset paths introduced a regression when using @nx/webpack:webpack executor.

When options are passed from the executor, the paths are relative to the workspace root not project root. Thus, we need special handling when normalizing executor options.

Current Behavior

Executor is resolving assets relative to project root.

Expected Behavior

Executor options should always be relative to workspace root for consistency.

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from a team as a code owner March 27, 2024 18:04
@jaysoo jaysoo requested a review from Coly010 March 27, 2024 18:04
Copy link

vercel bot commented Mar 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 1:05am

options // plugin options take precedence
options,
// executor options take precedence (especially for overriding with CLI args)
originalTargetOptions
Copy link
Member Author

Choose a reason for hiding this comment

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

The order here was previously set wrong. The executor options should override plugin options, since users can pass CLI args, or have overrides in configurations.

@jaysoo jaysoo enabled auto-merge (squash) March 27, 2024 19:58
@jaysoo jaysoo force-pushed the webpack_executor_assets branch from 2dcacc4 to 816cfb2 Compare March 28, 2024 01:04
@jaysoo jaysoo merged commit 7d2a420 into master Mar 28, 2024
5 of 6 checks passed
@jaysoo jaysoo deleted the webpack_executor_assets branch March 28, 2024 01:36
Copy link

github-actions bot commented Apr 4, 2024

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants