0

I am trying to create a composite gulp task which runs 2 separate watch tasks at the same time:

gulp.task('watch-css', watchCssTask); // uses gulp-stylus
gulp.task('watch-js', watchJsTask);   // uses watchify (browserify)

What is the correct way to achieve the following with gulp?

gulp.task('watch', watchCssAndJsTask);

For instance, with vanilla npm tasks I would just do this:

"scripts": {
    "watch-css": ...
    "watch-js": ...
    "watch": "npm run watch-css && npm run watch-js",
}
Lea Hayes
  • 62,536
  • 16
  • 62
  • 111

1 Answers1

0

The following seems to work:

gulp.task('watch', [ 'watch-css', 'watch-js' ]);
Lea Hayes
  • 62,536
  • 16
  • 62
  • 111
  • 1
    Its the right approach, that way it is separated and each task has its own responsibility without inflicting others, and you can reuse it like you did wherever you want. – Ran Sasportas Nov 10 '15 at 06:45