File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ module.exports = function (grunt) {
9494 'server.js' ,
9595 'lib/**/*.{js,json}'
9696 ] ,
97- tasks : [ 'newer:jshint:server' , 'express:dev' ] ,
97+ tasks : [ 'newer:jshint:server' , 'express:dev' , 'wait' ] ,
9898 options : {
9999 livereload : true ,
100100 nospawn : true //Without this option specified express won't be reloaded
@@ -427,6 +427,18 @@ module.exports = function (grunt) {
427427 }
428428 } ) ;
429429
430+ // Used for delaying livereload until after server has restarted
431+ grunt . registerTask ( 'wait ', function ( ) {
432+ grunt . log . ok ( 'Waiting for server reload...' ) ;
433+
434+ var done = this . async ( ) ;
435+
436+ setTimeout ( function ( ) {
437+ grunt . log . writeln ( 'Done waiting!' ) ;
438+ done ( ) ;
439+ } , 500 ) ;
440+ } );
441+
430442 grunt.registerTask('express-keepalive', 'Keep grunt running', function() {
431443 this . async ( ) ;
432444 } );
You can’t perform that action at this time.
0 commit comments