Promise friendly helper for gulp
npm i --save-dev pro-gulp
var gulp = require("gulp");
var proGulp = require("pro-gulp");
proGulp.task("task_0", function () {
return gulp.src("src/file_0")
.pipe(gulp.dest("dst/"));
});
proGulp.task("task_1", function () {
return gulp.src("src/file_1")
.pipe(gulp.dest("dst/"));
});
/*
* `proGulp.sequence` gives us the guarantee `task_0` only starts after
* `task_1` has completed
*/
proGulp.task("tasks", proGulp.sequence(["task_0", "task_1"]), function () {
// do stuff
});
/*
* Register a gulp task
*/
gulp.task("tasks", proGulp.task("tasks"));
npm test