-
-
Save dhruvr/c08bbd82f99e531e047586da96402fc6 to your computer and use it in GitHub Desktop.
Revisions
-
webdesserts revised this gist
Dec 2, 2013 . 1 changed file with 1 addition and 1 deletion.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 @@ -37,5 +37,5 @@ gulp.task('default', function() { // clean up if an error goes unhandled. process.on('exit', function() { if (node) node.kill() }) -
webdesserts revised this gist
Dec 2, 2013 . 1 changed file with 1 addition and 1 deletion.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 @@ -37,5 +37,5 @@ gulp.task('default', function() { // clean up if an error goes unhandled. process.on('exit', function() { node.kill() }) -
webdesserts revised this gist
Dec 2, 2013 . 1 changed file with 5 additions and 0 deletions.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 @@ -34,3 +34,8 @@ gulp.task('default', function() { // no more messing around with grunt-concurrent or the like. Gulp is // async by default. }) // clean up if an error goes unhandled. process.on('exit', function() { node.exit }) -
webdesserts revised this gist
Dec 2, 2013 . 1 changed file with 4 additions and 0 deletions.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 @@ -29,4 +29,8 @@ gulp.task('default', function() { gulp.watch(['./index.js', './lib/**/*.js'], function() { gulp.run('server') }) // Need to watch for sass changes too? Just add another watch call! // no more messing around with grunt-concurrent or the like. Gulp is // async by default. }) -
webdesserts revised this gist
Dec 2, 2013 . 2 changed files with 32 additions and 33 deletions.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 @@ -1,33 +0,0 @@ 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,32 @@ // NOTE: I previously suggested doing this through Grunt, but had plenty of problems with // my set up. Grunt did some weird things with scope, and I ended up using nodemon. This // setup is now using Gulp. It works exactly how I expect it to and is WAY more concise. var gulp = require('gulp'), spawn = require('child_process').spawn, node; /** * $ gulp server * description: launch the server. If there's a server already running, kill it. */ gulp.task('server', function() { if (node) node.kill() node = spawn('node', ['index.js'], {stdio: 'inherit'}) node.on('close', function (code) { if (code === 8) { gulp.log('Error detected, waiting for changes...'); } }); }) /** * $ gulp * description: start the development environment */ gulp.task('default', function() { gulp.run('server') gulp.watch(['./index.js', './lib/**/*.js'], function() { gulp.run('server') }) }) -
webdesserts revised this gist
Nov 5, 2013 . 1 changed file with 1 addition and 1 deletion.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 @@ -1,4 +1,4 @@ // NOTE: There are much better tools out there like nodemon that will do this for you. // I don't use this anymore (it had some issues), but I'm leaving it here for reference. var app = null -
webdesserts revised this gist
Nov 5, 2013 . 1 changed file with 3 additions and 0 deletions.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 @@ -1,3 +1,6 @@ // NOTE: There are much better tools out there like nodemon to do this for you. // I don't use this anymore (it had some issues), but I'm leaving it here for reference. var app = null module.exports = function(grunt) { -
webdesserts revised this gist
May 23, 2013 . 1 changed file with 4 additions and 1 deletion.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 @@ -20,7 +20,10 @@ module.exports = function(grunt) { grunt.registerTask('server', 'Start my server.', function() { if (app) app.kill(); app = grunt.util.spawn({ cmd: 'npm', args: ['start'], // can use "node server/index/whatever" here as well opts: {stdio: 'inherit'} }); }) grunt.registerTask('default', ['server','watch']) -
webdesserts revised this gist
May 23, 2013 . 1 changed file with 1 addition and 1 deletion.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 @@ -20,7 +20,7 @@ module.exports = function(grunt) { grunt.registerTask('server', 'Start my server.', function() { if (app) app.kill(); app = grunt.util.spawn({ cmd: 'npm', args: ['start'], opts: {stdio: 'inherit'} }); }) grunt.registerTask('default', ['server','watch']) -
webdesserts revised this gist
May 23, 2013 . 1 changed file with 1 addition and 2 deletions.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 @@ -1,12 +1,11 @@ var app = null module.exports = function(grunt) { grunt.initConfig({ watch: { js: { files: ['**/*.js', '!Gruntfile.js', '!node_modules/**/*'], // add/remove where needed tasks: ['server'], options: { // important! Allows you to use globals -
webdesserts created this gist
May 23, 2013 .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,28 @@ var app = null module.exports = function(grunt) { grunt.initConfig({ watch: { js: { files: ['**/*.js', '!Gruntfile.js', '!node_modules/**/*'], tasks: ['server'], options: { // important! Allows you to use globals // without it the task will be launched in it's own context nospawn: true } } }, }) grunt.loadNpmTasks('grunt-contrib-watch') grunt.registerTask('server', 'Start my server.', function() { if (app) app.kill(); app = grunt.util.spawn({ cmd: 'npm', args: ['start'] }); }) grunt.registerTask('default', ['server','watch']) }