答案 0 :(得分:0)
我使用run-sequence,可以通过npm获得(参见https://www.npmjs.com/package/run-sequence)。
在你的gulpfile中它看起来像这样:
gulp.task("dist-sequence", function() {
return runSequence("dist-clean",
[
"dist-client-js", "dist-vendor-js", "dist-client-css", "dist-vendor-css",
"dist-fonts", "dist-images", "dist-template", "dist-html"
],
"dist-index-inject");
});
runSequence
中调用的所有任务按照您声明的顺序运行。上面,当我调用dist-sequence
任务时,dist-clean
运行,然后执行所有任务并行运行的数组,完成后dist-index-inject
运行。