gulp - 检查 runSequence 是否失败

标签 gulp

我的 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/

相关文章:

html - Gulp html 布局插件

将 Gulp 控制台输出记录到文件中

node.js - 如何使用 --harmony 标志运行 gulp?

laravel - 我应该将 manifest.json 放在 Laravel 5.3 项目中的哪里?

Gulp watch 不发出事件对象

自更新到 MACOS Catalina 以来,Ruby 罗盘问题失败

javascript - gulp.src 基本选项应用于一个数组项

javascript - 如何使用 Browserify + Gulp 要求 Underscore 模板

node.js - 编译 Node 模块时 typescript 错误

node.js - gulp-sass错误: Unhandled stream error in pipe