You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR in main.js
main.js from Terser plugin
"Import" statement may only appear at the top level [main.js:12,0]
at js_error (/Users/xxxx/workspace/xxxx/node_modules/terser/dist/bundle.min.js:536:11)
at TreeWalker.visit (/Users/xxxx/workspace/xxxx/node_modules/terser/dist/bundle.min.js:11818:13)
at TreeWalker._visit (/Users/xxxx/workspace/xxxx/node_modules/terser/dist/bundle.min.js:6728:24)
at AST_Import._walk (/Users/xxxx/workspace/xxxx/node_modules/terser/dist/bundle.min.js:5122:28)
at walk_body (/Users/xxxx/workspace/xxxx/node_modules/terser/dist/bundle.min.js:3869:17)
at AST_Function.<anonymous> (/Users/xxxx/workspace/xxxx/node_modules/terser/dist/bundle.min.js:4368:17)
at /Users/xxxx/workspace/xxxx/node_modules/terser/dist/bundle.min.js:6729:21
at TreeWalker.visit (/Users/xxxx/workspace/xxxx/node_modules/terser/dist/bundle.min.js:11720:13)
at TreeWalker._visit (/Users/xxxx/workspace/xxxx/node_modules/terser/dist/bundle.min.js:6728:24)
at AST_Function._walk (/Users/xxxx/workspace/xxxx/node_modules/terser/dist/bundle.min.js:4362:28)
Expected Behavior
I was expecting optimization options to be unchanged when withModuleFederation plugin is used.
GitHub Repo
No response
Steps to Reproduce
Enable withNx, withReact, and withModuleFederation plugins
Optimization options after withModuleFederation will not have all of the default values
…#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
Current Behavior
I'm using NX-enhanced webpack plugins as per documentation to configure react and module federation, e.g.
I have noticed that the
optimization
options are lost whenwithModuleFederation
is invoked, e.g. when I do this:These are the config options before:
and this is after:
This is causing problems for me later on:
Expected Behavior
I was expecting
optimization
options to be unchanged whenwithModuleFederation
plugin is used.GitHub Repo
No response
Steps to Reproduce
withNx
,withReact
, andwithModuleFederation
pluginswithModuleFederation
will not have all of the default valuesNx Report
Failure Logs
No response
Package Manager Version
1.22.22
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: