Gulp Clock with Dependencies and Callback

Signature for gulp -watch

watch(glob, [options, callback]) 

However, it looks like you can either have a callback or parameters, but not both. I am trying to do this:

 gulp.watch('*.js',['someTask','anotherTask'],function(event){...}); 

It performs the dependent tasks "someTask" and "anotherTask", but does not perform a callback. You can get a callback:

 gulp.watch('*.js',function(event){...}); 

Or you can do dependencies:

 gulp.watch('*.js',['someTask','anotherTask']); 

But I can’t get him to do dependent tasks and give a callback.

+7
gulp
source share
1 answer

Try the following:

 gulp.watch('*.js',function(event){gulp.run('someTask','anotherTask')}); 
+3
source share

All Articles