It seems like uglify-js does not support es6?
PerterPon opened this issue · 11 comments
when I use generator, I got this error, will you support es6? Thank you.
Unexpected token operator «*»
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.
uglifyjs-webpack-plugin@1.x
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 ofuglify-es
that is under active developmentuglifyjs-webpack-plugin
went 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-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.
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. 🤷♂️