leny / gulp-supervisor

Run supervisor as a gulp task for easy integration with the rest of your workflow
MIT License
18 stars 6 forks source link

Add the callback argument to run tasks synchronously? #3

Open mxgit1090 opened 8 years ago

mxgit1090 commented 8 years ago

I use the supervisor to run the express project and use browserSync to monitor the changes of webpages then auto reload the browser. I am trying to merge the two tasks with gulp and run the tasks in one time. As my gulpfile.js is:

gulp.task('supervisor', function(cb) {
     supervisor('./app.js');
     cb();
});

gulp.task('another', ['supervisor'], function() {
     // The following task that should run after the supervisor
     browserSync().init(null, {
          proxy: 'http://localhost:3000',
          port: 4000
     });
     // Other tasks ...
});

But it always runs browserSync before supervisor ...

Maybe add event listener or configurations for the synchronous-running tasks ? Or another method to force the order of the two tasks? Thank you!!

leny commented 8 years ago

Hi,

Have you try run-sequence?