发布网友 发布时间:2022-04-24 22:58
共1个回答
热心网友 时间:2022-05-13 05:07
用plumber
var plumber = require('gulp-plumber');
var notify = require('gulp-notify');
//js合并压缩
gulp.task('minifyjs', function() {
return gulp.src(jsSrcPath)
.pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') }))
.pipe(concat('app.js'))
.pipe(gulp.dest(distPath))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest(distPath));
});