Reputation: 22440
I have a node app "generate.js" that generates a set of static files.
My goal is that when ever any files in /foo/ directory are modified, that generate.js is run once.
And, I would like to do this using a Gulp watch task.
In the past, I have done similar using Grunt and the grunt-execute plugin. But, I haven't found a way to do it with Gulp.
Upvotes: 0
Views: 128
Reputation: 2721
Gulp code is ordinary javascript. So you can just run your process using node's built in child_process
module.
var cp = import('child_process');
gulp.task('taskname', function(callback) {
// Start your child process here
cp.spawn(/*...*/);
});
Upvotes: 1