Webpack executor minimizes classnames when optimization: true
See original GitHub issueCurrent Behavior
Webpack executor minimizes classnames when optimization is set to true.
It was fixed in this #8537
This happens since normalize-options.ts transforms optimization option from true to {scripts: true, styles: true}.
Expected Behavior
Optimization options should work as intended in #8537
Environment
Node : 16.13.0 OS : linux x64 yarn : 1.22.17
nx : 15.0.0 @nrwl/angular : Not Found @nrwl/cypress : 15.0.0 @nrwl/detox : Not Found @nrwl/devkit : 15.0.0 @nrwl/esbuild : Not Found @nrwl/eslint-plugin-nx : 15.0.0 @nrwl/expo : Not Found @nrwl/express : 15.0.0 @nrwl/jest : 15.0.0 @nrwl/js : 15.0.0 @nrwl/linter : 15.0.0 @nrwl/nest : 15.0.0 @nrwl/next : 15.0.0 @nrwl/node : 15.0.0 @nrwl/nx-cloud : 14.7.0 @nrwl/nx-plugin : 15.0.0 @nrwl/react : 15.0.0 @nrwl/react-native : Not Found @nrwl/rollup : 15.0.0 @nrwl/schematics : Not Found @nrwl/storybook : 15.0.0 @nrwl/web : 15.0.0 @nrwl/webpack : 15.0.0 @nrwl/workspace : 15.0.0 typescript : 4.8.4
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:5 (1 by maintainers)

Top Related StackOverflow Question
Yeah this is intended since optimization for styles means minifying the class names. We don’t recommend turning this off for production, but you want to you can pass
{ scripts: true, styles: false }in yourproject.jsonfile.I found this issue while trying to upgrade from 14.7.5 to the latest 14.x minor version (can’t upgrade to 15.x yet due to some Angular dependencies).
It looks like the referenced commit was pushed briefly after 14.7.5, but hasn’t been fixed on the 14.8.x branch.
Is there a chance the fix will be applied to that branch, too? I’ve looked into the Git history and it seems like most fixes for 15.x have been almost immediately cherry-picked to 14.8.x.
Is there any particular reason this hasn’t been cherry-picked to 14.8.x?
Just trying to understand. Thanks in advance for any answer.
EDIT: Just realized that Angular 15 support was introduced in 15.2.0, so I’ll try upgrading to 15.1.1 for now.