Reputation: 19453
The js file being compressed is output with the same filename.
gulp.task('compressjs', function () {
gulp.src('app/**/*.js')
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
How can I have it output the file with min.js
at the back?
Upvotes: 64
Views: 27940
Reputation: 35806
You can use the suffix
or extname
parameters of gulp-rename like:
gulp.task('compressjs', function () {
gulp.src('app/**/*.js')
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('dist'))
})
Upvotes: 130