-
Notifications
You must be signed in to change notification settings - Fork 348
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's not recognizing "let" keyword, any plans to support it ? #480
Comments
https://github.com/gruntjs/grunt-contrib-uglify/tree/harmony |
Thanks, Does uglify-es have backward compatibility for ES5 code as well ? |
Yes. |
How do I get the harmony branch , because when I do |
hi sohansoni, |
Found it on https://stackoverflow.com/questions/44848273/how-to-integrate-uglify-es-in-grunt
If you are behind a firewall like me, please also notice npm/npm#5257. The following worked fine for me:
|
Thanks for this! Was searching for so long, I thought I was never going to find the answer. |
When is |
I have a weird issue with the "harmony" branch as of 3 days ago. Two different functions are getting uglified into the exact same method name, which causes my code to break. I found that this older commit from the "harmony" branch gets me back to where I was before: npm install git://github.com/gruntjs/grunt-contrib-uglify.git#c2ccee1b61a585c5f4fca00da8f79cc1db37048b --save-dev There is probably a more recent commit, but this worked, so I am using it for now. If I have time, I'll try to put together a minimum reproducible test case. I'm seeing it in an Angular JS project that uses this dependency: https://github.com/chieffancypants/angular-hotkeys. At first I thought it was due to a change to angular-hotkeys, but then realized it only happened with the uglified code. |
I also experienced various errors with everything breaking suddenly, the following fixed it for me: package.json
grunt.js
.babelrc
|
Use - https://www.npmjs.com/package/terser npm install terser It's APIs are compatible with UglifyJS@3 and supports |
I had a similar issue (i.e. not supporting ES6) and fixed it as follows:
|
Terser is adaptive to ES6+
|
It's not recognizing "let" keyword, any plans to support it ?
for e.g. my code is as below
for (let key in item) {
and error is as below:
{ message: 'Unexpected token name «key», expected punc «;»',
The text was updated successfully, but these errors were encountered: