[@nrwl/web:webpack] Bundle is not minified when compiler is set as "swc" on production configuration
See original GitHub issueCurrent Behavior
Bundle is not minified when compiler
is "swc"
and optimization
is true
.
Expected Behavior
Bundle is minified when compiler
is "swc"
and optimization
is true
.
Steps to Reproduce
- Create a React workspace
npx create-nx-workspace --preset=react
- Set compiler option in
project.json
of main app as"swc"
- Build
Failure Logs
None.
Environment
Node : 16.15.1
OS : win32 x64
npm : 8.11.0
nx : 14.5.10
@nrwl/angular : Not Found
@nrwl/cypress : 14.5.10
@nrwl/detox : Not Found
@nrwl/devkit : 14.5.10
@nrwl/eslint-plugin-nx : 14.5.10
@nrwl/express : Not Found
@nrwl/jest : 14.5.10
@nrwl/js : 14.5.10
@nrwl/linter : 14.5.10
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : 14.5.10
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.5.10
@nrwl/web : 14.5.10
@nrwl/workspace : 14.5.10
typescript : 4.8.2
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Webpack build does not remove dead code with SWC as ...
Webpack build does not remove dead code with SWC as compiler in ... From inspecting the produced webpack config, it seems no minifier...
Read more >@nrwl/web:webpack | Nx
@nrwl/web:webpack. Builds web applications using webpack. Options can be configured in project.json when defining the executor, or when invoking it.
Read more >Webpack - Why is my bundle.js file minified by default?
As you are using webpack 4. One of the ways is : Inside package.json set scripts to either development or production mode
Read more >How to use custom webpack configuration in an Nx project?
How to customize webpack config for an NX project? · Go to the workspace.json file · Find the project you wish to edit...
Read more >Migrating to SWC: A brief overview - LogRocket Blog
If you do not have a compiler defined, you can simply add the following to your webpack configuration instead of replacing it. module.exports...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just came across it and this is still happening. Maybe connected to other SWC issues with dead code removal.
This issue has been automatically marked as stale because it hasn’t had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏