Livereload is no longer fully restarting server
Problem
I am currently using Grunt and livereload, but for some reason in the last while it no longer does a full Server restart when server files are changed. It is watching the server files and I get a Reload server/some_dir/some_file.js
message when a file changes but that doesn't seem to be enough.
watch: {
jade: {
files: [
'/**/*.jade',
'/**/*.jade'
],
tasks: ['jade']
},
compass: {
files: ['/styles/{,*/}*.{scss,sass}'],
tasks: ['compass']
},
livereload: {
options: { livereload: true },
files: [
'{.tmp,}/**/*.js',
'{.tmp,}/styles/{,*/}*.css',
'{.tmp,}/scripts/**/*.js',
'{.tmp,}/**/*.html',
'/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
],
tasks: ['livereload']
},
server: {
files: [ './server/**/*' ],
tasks: [ 'express:dev', 'livereload-start' ]
}
}
grunt.registerTask('server', [
'clean:server',
'jade',
'compass:server',
'express:dev',
'livereload-start',
'connect:livereload',
'watch' // if I replace this with 'watch:server' the server does restart properly, but html/css updates are obviously gone
]);
Problem courtesy of: chris
Solution
Changing
server: {
files: [ './server/**/*' ],
tasks: [ 'express:dev', 'livereload-start' ]
}
to
server: {
files: [ './server/**/*' ],
tasks: [ 'express:dev', 'livereload' ]
}
Not sure what recent change caused this to break. According to git the former snippet was used since the start of the project.
Solution courtesy of: chris
Discussion
View additional discussion.