I still dont see how this actually solves the question at hand.
If i have 4 tasks with dependencies defined between them
A,B,C,D
where A depends on B, etc as defined by gulp.task('A',['B'],function A(){});
and then i defined a new task using gulp.watch running just the functions would duplicate the dependencies.
e.g given these tasks (each tasks function exposed via name):
function A(){}
gulp.task('A',['B'],A);
function A(){}
gulp.task('A',['B'],A);
function B(){}
gulp.task('B',['C'],B);
function C(){}
gulp.task('C',['D'],C);
function D(){}
gulp.task('D',[],D);
i can write 1)
gulp.task('WATCHER', ['A'], function(){
...
}
which would execute A->D but if e.g Step B fails it would never enter the task (think of compile or test error)
or i can write 2)
gulp.task('WATCHER', [], function(){
gulp.watch(...,['A'])
}
which would not run A->D until something was changed first.
or i can write 3)
gulp.task('WATCHER', [], function(){
D();
C();
B();
A();
gulp.watch(...,['A'])
}
which would cause duplication (and errors over time) of the dependency hierarchy.
PS: In case someone is wondering why i would want my watch task to execute if any of the dependent tasks fail that is usually because i use watch for live development. eg. i start my watch task to begin working on tests etc. and it can be that the initial code i start out with already has issues thus errors.
So i would hope that gulp run or some equivalent stays for some time
scripts
, but it also makes sense to force run this task right away (without waiting until some script file changes). – Diencephalon