Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gulp Watch with Dependencies and Callback

Tags:

gulp

The signature for gulp-watch is

watch(glob, [options, callback])

However, it seems like you can either have a callback or options but not both. What I am trying to do is:

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

It executes the dependent tasks 'someTask' and 'anotherTask' but does not execute the callback. You can have a callback:

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

Or you can execute dependencies:

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

But I cannot get it to execute dependent tasks and give me a callback.

like image 292
eeejay Avatar asked Feb 04 '15 23:02

eeejay


1 Answers

Try this:

gulp.watch('*.js',function(event){gulp.run('someTask','anotherTask')});
like image 142
Gabriel Kohen Avatar answered Oct 14 '22 09:10

Gabriel Kohen