问题描述:

For example, the code below will run the tasks asynchronized, but i want them to run one after another. So "concat" should be finished first, then run "autoprefix", then run "minify".

gulp.task("watch", function ()

{gulp.watch("*.css", ["concat", "autoprefix", "minify"]);

});

网友答案:

Gulp 4.0 (3.9.1 as of right now) has the ability to run tasks in sequence/series.

https://github.com/gulpjs/gulp/blob/4.0/docs/API.md#gulpseriestasks

For now, you could use the run-sequence package.

https://www.npmjs.com/package/run-sequence

相关阅读:
Top