Skip to content

Commit

Permalink
fix(module-federation): optimization should not be overwritten #27201 (
Browse files Browse the repository at this point in the history
…#27376)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
`withModuleFederation` is overwriting `config.optimization` rather than
merging it.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`config.optimization` should be merged

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #27201
  • Loading branch information
Coly010 committed Aug 12, 2024
1 parent 69fac03 commit f208acd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export async function withModuleFederationForSSR(
config.target = false;
config.output.uniqueName = options.name;
config.optimization = {
...(config.optimization ?? {}),
runtimeChunk: false,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export async function withModuleFederation(
}

config.optimization = {
...(config.optimization ?? {}),
runtimeChunk: false,
};

Expand Down

0 comments on commit f208acd

Please sign in to comment.