when I use generator, I got this error, will you support es6? Thank you.
Unexpected token operator «*»
It's still not in, but you can follow #448 if you want
As @avdg indicated, you can follow #448 for es6 support. Thanks!
This is the official uglify package for ES6/ES2015:
Can anybody(@phoenixeliot) tell why there is a downvote for @Piusha, the answer worked for me?
Is there any issue with the package, its mentioned in the webpack site itself !
I was facing issue with webpack.optimize.UglifyJsPlugin for a simple code 10 ** 5.
I got it working with uglifyjs-webpack-plugin .
Anyone can downvote anything on github. It doesn't mean their opinion is necessarily correct.
[email protected] is an uglify-es wrapper library supported the webpack project. It appears to works fine for ES6+. Any questions for that plugin should be directed to https://github.com/webpack-contrib/uglifyjs-webpack-plugin
Simple to me: UglifyJS does not support ES6 anymore from 2.0 as per the release notes.
https://github.com/webpack-contrib/uglifyjs-webpack-plugin/releases/tag/v2.0.0
UglifyJS never supported es6 feature from master, all work on es6 and later was done on a separate branch or on separate projects.
In case anybody else is as confused as I was an hour ago:
uglify-js has never supported ES6uglify-es supports ES6 but was abandonedtercer is a fork of uglify-es that is under active developmentuglifyjs-webpack-plugin went from using uglify-js (no ES6) under the hood, to uglify-es (yes ES6), back to uglify-js (no ES6), and now uses tercer (yes ES6).If you, like me, ever manually made an instance of uglifyjs-webpack-plugin in your config (probably to specify non-default options), you briefly had ES6 support but it went away again through no fault of your own. Switch to tercer-webpack-plugin, rename uglifyOptions to tercerOptions, and everything will probably be fine.
@thw0rted For anyone else reading, it's _terser_. Thanks for the clarification @thw0rted
Well, hell. I must have been pretty burned out by the time I wrote that because I had it right in my notes, and of course "terser" is a clever play on words while "tercer" means nothing. I'm really impressed I managed to get it wrong like 5 times, consistently, in that one post. 🤷♂️
Most helpful comment
In case anybody else is as confused as I was an hour ago:
uglify-jshas never supported ES6uglify-essupports ES6 but was abandonedterceris a fork ofuglify-esthat is under active developmentuglifyjs-webpack-pluginwent from usinguglify-js(no ES6) under the hood, touglify-es(yes ES6), back touglify-js(no ES6), and now usestercer(yes ES6).If you, like me, ever manually made an instance of
uglifyjs-webpack-pluginin your config (probably to specify non-default options), you briefly had ES6 support but it went away again through no fault of your own. Switch totercer-webpack-plugin, renameuglifyOptionstotercerOptions, and everything will probably be fine.