Skip to content
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

It seems like uglify-js does not support es6? #659

Closed
PerterPon opened this issue Mar 28, 2015 · 11 comments
Closed

It seems like uglify-js does not support es6? #659

PerterPon opened this issue Mar 28, 2015 · 11 comments

Comments

@PerterPon
Copy link

when I use generator, I got this error, will you support es6? Thank you.

Unexpected token operator «*»
@PerterPon PerterPon changed the title It seems like uglify-js does not suppport es6? It seems like uglify-js does not support es6? Mar 28, 2015
@avdg
Copy link
Contributor

avdg commented Mar 28, 2015

It's still not in, but you can follow #448 if you want

@rvanvelzen
Copy link
Collaborator

As @avdg indicated, you can follow #448 for es6 support. Thanks!

@Piusha
Copy link

Piusha commented May 12, 2017

Try this

https://webpack.js.org/plugins/uglifyjs-webpack-plugin/

@kzc
Copy link
Contributor

kzc commented May 21, 2017

This is the official uglify package for ES6/ES2015:

https://www.npmjs.com/package/uglify-es

@var23rav
Copy link

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 .

@kzc
Copy link
Contributor

kzc commented Dec 10, 2017

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

@GabrielGil
Copy link

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

@avdg
Copy link
Contributor

avdg commented Oct 6, 2018

UglifyJS never supported es6 feature from master, all work on es6 and later was done on a separate branch or on separate projects.

@thw0rted
Copy link

In case anybody else is as confused as I was an hour ago:

  • uglify-js has never supported ES6
  • uglify-es supports ES6 but was abandoned
  • tercer is a fork of uglify-es that is under active development
  • uglifyjs-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.

@nickgeorgiou
Copy link

@thw0rted For anyone else reading, it's terser. Thanks for the clarification @thw0rted

@thw0rted
Copy link

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. 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants