gulp v4。无法弄清楚为什么该系列不能运行

时间:2018-07-12 01:54:39

标签: javascript node.js gulp

运行节点10+,以及gulp-cli 2.0.1和gulp 4 alpha 3。

因此,我在gulpfile中定义了一些任务。就像我现在拥有的那样,如果我“单独”运行每个单独的任务,它们将完美运行。
当我开始使用gulp.series时,我会不断得到以下信息:

$ gulp build
[16:53:39] Starting 'build'...
[16:53:39] Starting 'clean-local'...
[16:53:39] Finished 'clean-local' after 398 ms
[16:53:39] The following tasks did not complete: build
[16:53:39] Did you forget to signal async completion?

我无法为自己的生活弄清楚为什么这行不通。这是一个示例“删除”功能:

const del = require('del');
const gulp = require('gulp');

const pipes = {};
pipes.cleanLocal = () => del([
  '.app/client/libs/**/*'
]);

然后在gulp任务中使用它:

gulp.task('clean-local', pipes.cleanLocal);

在这一点上,运行gulp clean-local可以很好地执行,并且可以完成它应该做的事情。 但是,当我尝试串联使用它时,出现错误,提示我没有说它“完成”。这也是从他们的文档中提取出来的。

gulp.task('test', gulp.series('clean-local', 'clean-local', done => {
  done();
}));

$gulp test
[17:48:59] Using gulpfile /path/to/my/gulpfile.js
[17:48:59] Starting 'test'...
[17:48:59] Starting 'clean-local'...
[17:48:59] Finished 'clean-local' after 6.92 ms
[17:48:59] The following tasks did not complete: test
[17:48:59] Did you forget to signal async completion?

有没有比我聪明的人可以弄清楚为什么它不起作用?我只能这么撞墙:(

0 个答案:

没有答案