New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build executor: class name minification should be optional when using optimization: true #8537
Comments
We are also running into this issue. I am not sure what optimization does other than minify class names/variables. But if there are other features, it would be useful to be able to have optimized builds while not breaking the reflection due to changes in the class names. |
I investigated a bit, it seems a possible quick fix would be to configure TerserPlugin to not mangle names in node.config.ts
I can make a PR of the quick fix if necessary, but Nx core dev team might want to expose the terserOptions in the build settings (so some users can still mangle the names and customize minification for production) so it would be more involved than this. |
disable name mangling when building for production with optimization on, in order not to break features relying on runtime reflection ISSUES CLOSED: nrwl#8537
Hey, |
disable name mangling when building for production with optimization on, in order not to break features relying on runtime reflection ISSUES CLOSED: nrwl#8537
disable name mangling when building for production with optimization on, in order not to break features relying on runtime reflection ISSUES CLOSED: #8537
It seems that this solution does not work on my side. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Since 13.4, when building for production with optimization on, it also minify the class names causing a variety of issues with library depending on reflection.
There are several issues already reported :
13.2.x
to13.4.x
#8446Expected Behavior
When building for production, class name minification should be easily configurable and opt-out in build settings, so we can have the same behavior as 13.2.
Disabling optimization could be a workaround, but it also disable the process.env.NODE_ENV substitution, which is problematic in my case
Steps to Reproduce
Create a simple node js app, it should generate a production configuration.
Build as usual :
npx nx build --configuration=production
Inspect the output main.js in dist/ : class names are minified
Environment
The text was updated successfully, but these errors were encountered: