如何在gulp 4中使用gulp.series?

时间:2019-04-29 17:09:41

标签: gulp gulp-4

有一个超级简单的gulp文件,我要在其中依次运行一些基本的gulp任务。

我似乎无法在Gulp v4中运行它。在Gulp v3中使用run-sequence代替了gulp.series()

const gulp = require("gulp");
const clean = require('gulp-clean');

gulp.task('clean-app', async () => {
  return (gulp.src('./dist/app', {read: true, allowEmpty: true})
    .pipe(clean()));
});


gulp.task('clean-tests', async () => {
  return ( gulp.src('./dist/tests', {read: true, allowEmpty: true})
    .pipe(clean()));
});

gulp.task('all-tasks', gulp.series('clean-app', 'clean-tests'));

单个gulp任务clean-appclean-tests分别运行良好。

但是,当我使用gulp all-tasks时,出现以下错误

gulp all-tasks
[17:50:51] Using gulpfile ~\IdeaProjects\my-app\gulpfile.js
[17:50:51] Starting 'all-tasks'...
[17:50:51] Starting 'clean-app'...
[17:50:51] Finished 'clean-app' after 10 ms
[17:50:51] The following tasks did not complete: all-tasks
[17:50:51] Did you forget to signal async completion?

clean-appclean-tests都返回我认为足够的流。

尝试使用gulp4-run-sequence,但出现相同的错误。

希望能够运行gulp all-tasks,以便在clean-tests成功完成之后执行clean-app

1 个答案:

答案 0 :(得分:0)

根据官方文档here,尝试在您的任务中运行docker pull "$endpoint"/interos-jenkins:latest

cb()
相关问题