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): don't overwrite output config #22116

Merged
merged 2 commits into from
May 8, 2024
Merged

fix(webpack): don't overwrite output config #22116

merged 2 commits into from
May 8, 2024

Conversation

mikejpeters
Copy link
Contributor

@mikejpeters mikejpeters commented Mar 2, 2024

Current Behavior

Some webpack output options, like filename are overwritten when using the NxWebpackPlugin, e.g.

module.exports = {
  output: {
    path: join(__dirname, '../../dist/apps/my-app'),
    // this has no affect:
    filename: ({ runtime }) =>
      migrationEntryPoints.some(({ entryName }) => entryName === runtime)
        ? 'migrations/[name].js'
        : '[name].js',
  },
  plugins: [
    new NxWebpackPlugin({ ... }),
  ]
};

Expected Behavior

The NxWebpackPlugin should preserve base config where it makes sense.

I think this is the intended behaviour, but required some extra parentheses to behave correctly.

@mikejpeters mikejpeters requested a review from a team as a code owner March 2, 2024 20:49
@mikejpeters mikejpeters requested a review from ndcunningham March 2, 2024 20:49
Copy link

vercel bot commented Mar 2, 2024

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

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview May 8, 2024 1:36pm

@Coly010 Coly010 enabled auto-merge (squash) May 8, 2024 11:06
@Coly010 Coly010 merged commit 1449d1a into nrwl:master May 8, 2024
6 checks passed
FrozenPandaz pushed a commit that referenced this pull request May 9, 2024
## Current Behavior

Some webpack output options, like `filename` are overwritten when using
the `NxWebpackPlugin`, e.g.

```ts
module.exports = {
  output: {
    path: join(__dirname, '../../dist/apps/my-app'),
    // this has no affect:
    filename: ({ runtime }) =>
      migrationEntryPoints.some(({ entryName }) => entryName === runtime)
        ? 'migrations/[name].js'
        : '[name].js',
  },
  plugins: [
    new NxWebpackPlugin({ ... }),
  ]
};
```

## Expected Behavior

The `NxWebpackPlugin` should preserve base config where it makes sense.

I think this is the intended behaviour, but required some extra
parentheses to behave correctly.

(cherry picked from commit 1449d1a)
Copy link

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 May 19, 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.

2 participants