question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[@nrwl/web:webpack] Bundle is not minified when compiler is set as "swc" on production configuration

See original GitHub issue

Current 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

  1. Create a React workspace
npx create-nx-workspace --preset=react
  1. Set compiler option in project.json of main app as "swc"
  2. 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:closed
  • Created a year ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
NiklasPorcommented, Oct 13, 2022

I just came across it and this is still happening. Maybe connected to other SWC issues with dead code removal.

2reactions
github-actions[bot]commented, Sep 23, 2022

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! 🙏

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found