Created
May 27, 2014 12:18
-
-
Save frankdejonge/92593dd3e208920471eb to your computer and use it in GitHub Desktop.
Watched Gulpfile.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var spawn = require('child_process').spawn; | |
var subprocess; | |
function refreshGulpfile() { | |
if (subprocess) subprocess.kill(); | |
subprocess = spawn('gulp', ['watched-default'], {stdio: 'inherit'}); | |
} | |
gulp.task('default', function () { | |
refreshGulpfile(); | |
gulp.watch('gulpfile.js', refreshGulpfile); | |
}); | |
gulp.task('watched-default', function () { | |
// Put normal default stuff in here! | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment