Gulp output uuglify min.js

The compressed js file is output with the same file name.

gulp.task('compressjs', function () { gulp.src('app/**/*.js') .pipe(uglify()) .pipe(gulp.dest('dist')); }); 

How can I make it output the file with min.js at the back?

+51
gulp gulp-uglify
Jan 13 '15 at 6:23
source share
1 answer

You can use suffix or extname gulp-rename parameters, for example:

 gulp.task('compressjs', function () { gulp.src('app/**/*.js') .pipe(uglify()) .pipe(rename({ suffix: '.min' })) .pipe(gulp.dest('dist')) }) 
+96
Jan 13 '15 at 8:40
source share



All Articles