简体   繁体   中英

How to integrate uglify-es in grunt?

I'm using gruntjs (which uses uglifyjs ) to build my Angularjs app. But uglifyjs still does not support es6, so in corresponding GitHub issue i found this . So now there is uglify-es, which seemingly supports es6. But I'm not sure how to integrate it with grunt. Now i have module "grunt-contrib-uglify" , which has a dependency uglifyjs , which is now used. How can i make grunt use uglify-es instead?

我通过安装支持es6的grunt-contrib-uglify uglify的和声分支实现了这个目的:

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

The ECMAScript version has finally been released. You can now get the same result with the official version (it's no longer needed to pick it from GitHub)

npm install grunt-contrib-uglify-es --save-dev

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM