Added overload of gulp.task method with dependencies

This commit is contained in:
Petr Koutny
2017-12-19 20:38:50 +01:00
parent 468930f857
commit eb806511c3
2 changed files with 15 additions and 0 deletions

View File

@@ -57,6 +57,14 @@ declare class Undertaker extends EventEmitter {
*/
task(taskName: string, fn: Undertaker.TaskFunction): void;
/**
* Register the task by the taskName.
* @param taskName - Task name.
* @param dependencies - Task dependencies.
* @param fn - Task function.
*/
task(taskName: string, dependencies: string[], fn: Undertaker.TaskFunction): void;
/**
* Register the task by the name property of the function.
* @param fn - Task function.

View File

@@ -22,6 +22,13 @@ taker.task("task3", () => {
});
});
taker.task("task3", ["task1"], () => {
return new Promise((resolve, reject) => {
// do things depending on "task1"
resolve(); // when everything is done
});
});
taker.task("combined", taker.series("task1", "task2"));
taker.task("all", taker.parallel("combined", "task3"));