[英]Gulp uglify output min.js
The js file being compressed is output with the same filename. 正在压缩的js文件以相同的文件名输出。
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? 我怎么能让它输出后面的
min.js
文件?
You can use the suffix
or extname
parameters of gulp-rename like: 您可以使用gulp-rename的
suffix
或extname
参数,如:
gulp.task('compressjs', function () {
gulp.src('app/**/*.js')
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('dist'))
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.