some es6 features are not understood by grunt uglify js?

前端 未结 5 1651
眼角桃花
眼角桃花 2020-12-11 00:41

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

5条回答
  •  清歌不尽
    2020-12-11 01:09

    If the resulting code does not need to use ES6 syntax, it is also possible to transpile ES6 to ES5, before uglifying your code. This can for example be done with the Grunt task grunt-es6-transpiler.

提交回复
热议问题