有一个超级简单的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-app
和clean-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-app
和clean-tests
都返回我认为足够的流。
尝试使用gulp4-run-sequence,但出现相同的错误。
希望能够运行gulp all-tasks
,以便在clean-tests
成功完成之后执行clean-app
。