eeejay
eeejay

Reputation: 5894

Gulp Watch with Dependencies and Callback

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.

Upvotes: 7

Views: 3538

Answers (1)

Gabriel Kohen
Gabriel Kohen

Reputation: 4286

Try this:

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

Upvotes: 3

Related Questions