some es6 features are not understood by grunt uglify js?

user6536526 picture user6536526 · Jul 18, 2016 · Viewed 13k times · Source

I used grunt-uglify in my project and I'm working with es6. for some es6 features, such as fat arrow function, it's throwing an error. I think the uglify don't understant that syntax. so do i have a way to fix this issue. I mean can i use anything to make uglify understand all the es6 syntaxes?

Answer

Yevhenii Bahmutskyi picture Yevhenii Bahmutskyi · Jul 3, 2017

You can use the harmony branch of grunt-contrib-uglify.

npm install git://github.com/gruntjs/grunt-contrib-uglify.git#harmony --save-dev

works perfectly with es6. No additional settings for grunt are required.