How to minify ES6 functions with gulp-uglify?
You can leverage gulp-babel as such… const gulp = require(‘gulp’); const babel = require(‘gulp-babel’); const uglify = require(‘gulp-uglify’); gulp.task(‘minify’, () => { return gulp.src(‘src/**/*.js’) .pipe(babel({ presets: [‘es2015’] })) .pipe(uglify()) // […] }); This will transpile your es6 early in the pipeline and churn out as widely supported “plain” javascript by the time you minify. May … Read more