7

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.

hon2a
  • 7,006
  • 5
  • 41
  • 55
eeejay
  • 5,394
  • 8
  • 29
  • 30

1 Answers1

3

Try this:

gulp.watch('*.js',function(event){gulp.run('someTask','anotherTask')});
Gabriel Kohen
  • 4,166
  • 4
  • 31
  • 46
  • 1
    [`gulp.run` has been deprecated](https://github.com/gulpjs/gulp/issues/199). [See here](http://stackoverflow.com/questions/28826418/gulp-run-alternative) for alternatives. – tforgione Feb 15 '16 at 07:34