Minify (not transpile) ES2015 code with Gulp

后端 未结 2 2004
轻奢々
轻奢々 2021-02-07 03:02

How to minify ES2015 code without transpiling it to ES5? The popular gulp-minify and gulp-uglify modules do not work with simply minifying ES2015 code.

2条回答
  •  孤街浪徒
    2021-02-07 03:18

    Currently, the only way to minify ES2015 with gulp is to use gulp-babel which will transform ES2015 to "traditional" Javascript and then use gulp-uglify and gulp-minify.

    Learn more at: gulp-babel

提交回复
热议问题