代码如下:
gulp.task('copyfonts',function(){
return gulp.src(staticConfig['fonts'] + '/')
.pipe(gulp.dest('./dist/fonts/'));
})
然后我想监控 copyfonts 任务是否成功
gulp.task('aaa', ['copyfonts'],function(err){
console.log(err)
});
此时没有输出
假如改成一个不存在地址:
gulp.task('copyfonts',function(){
return gulp.src(staticConfig['foxxxnts'] + '/')
.pipe(gulp.dest('./dist/fonts/'));
})
还是没有输出!
问题是如何监控copyfonts 是否成功执行??
gulp’s task system is based on orchestrator. Several events are provided:
start
,stop
,err
,task_start
,task_stop
,task_err
,task_not_found
,task_recursion
.You can monitor it as follows
There is also a ready-made plug-in gulp-plumber to monitor task exceptions.