terinjokes/gulp-uglify

Task not compressing

Opened this issue · 3 comments

I'm trying to use gulp-uglify to compress es6 code (not es5). I have the following task, but nothing happens:

const compress = require('gulp-uglify')

gulp.task('compress', function() {
  gulp.src('./js.app.js')
    .pipe(compress({
      compress: {
        collapse_vars: true
      },
    }))
    .pipe(gulp.dest('./js'))
})
//...
gulp.task('default', ['compress', 'serve', 'watch'])

This worked with the rollup-uglify plugin, but that doesn't support es6 minification.

You need to return from the Gulp task.

Hmm... So:

gulp.task('compress', function() {
  return gulp.src('./js.app.js')
   .pipe(compress({
      compress: {
        collapse_vars: true
      },
    }))
    .pipe(gulp.dest('./js'))
})

That does nothing as well.

Tried following the suggestion in the README of usingpump so you can get error messages?