Leon Revill Leon Revill - 3 months ago 26
Javascript Question

How to minify (not transpile) ES2015 code with gulp

It appears that the popular

gulp-minify
and
gulp-uglify
modules do not work with simply minifying ES2015 code and I cannot find any additional information through Google. I was hoping someone else has come up against this problem and has a solution?

Thank you.

Answer

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

Comments