Created
December 29, 2016 11:16
-
-
Save Jeff2Ma/a20c652cb56c5411bad5f5879b7c4098 to your computer and use it in GitHub Desktop.
Revisions
-
tilap created this gist
Jun 28, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ // Gulp restart when gulpfile is changed var spawn = require('child_process').spawn; gulp.task('gulp-autoreload', function() { // Store current process if any var p; gulp.watch('gulpfile.js', spawnChildren); // Comment the line below if you start your server by yourslef anywhere else spawnChildren(); function spawnChildren(e) { if(p) { p.kill(); } p = spawn('gulp', ['build'], {stdio: 'inherit'}); } }); gulp.task('build', function() { // Your stuff here with build // Moreover, it's a good idea to have livereload if necessary })