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.


尝试这个:

gulp.watch('*.js',function(event){gulp.run('someTask','anotherTask')});
链接地址: http://www.djcxy.com/p/24674.html

上一篇: Java 8中运算符的便捷函数?

下一篇: 充满了依赖性和回调的Gulp手表