我的 gulpfile 有以下任务:
gulp.task('build', function (cb) {
return runSequence(
'clean',
'tsd',
'ts-lint',
['sass', 'copy-assets', 'ts-compile', 'templates', 'copy-vendor'],
'karma-once',
'index',
cb
);
});
如何检查
runSequence
中是否有任何任务 gulp 失败?
最佳答案
runSequence
的回调函数接受作为最后一个参数,给你一个 err
对象,如果某些任务失败。
runSequence('mytask', ['othertask'], function(err) {
if (err) {
// you can check for err.message or err.task for the name of the task
}
});
关于gulp - 检查 runSequence 是否失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27806092/