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
{{ message }}
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
I know that the config is being parsed properly, because I get errors if I place keep_classnames directly in the UglifyJSPlugin config object or change keep_classnames into a typo anywhere.
The text was updated successfully, but these errors were encountered:
lgarron
changed the title
Can't set keep_classnames on uglifyjs-webpack-pluginkeep_classnames on uglifyjs-webpack-plugin doesn't work
Jul 12, 2018
lgarron
changed the title
keep_classnames on uglifyjs-webpack-plugin doesn't work
Can't keep class names using uglifyjs-webpack-plugin with "mode": "production"
Jul 12, 2018
Okay, I think I figured it out. An output target of ES5 in tsconfig.json was probably converting classes to functions before they reached UglifyJS, at which point keep_classnames did nothing.
Changing tsconfig.json to emit ES6 seems to work, although I still need to construct the production config from scratch instead of overwriting just the UglifyJS pluging.
As soon as I set
module.exports.mode = "production"
, class names are mangled.Some references:
https://webpack.js.org/plugins/uglifyjs-webpack-plugin/
https://github.com/webpack-contrib/uglifyjs-webpack-plugin
Absolutely nothing works to keep the class names, including this overkill config:
Or this one:
I know that the config is being parsed properly, because I get errors if I place
keep_classnames
directly in theUglifyJSPlugin
config object or changekeep_classnames
into a typo anywhere.The text was updated successfully, but these errors were encountered: