I trying to add livereload of broser when changing my files, but browser not reloading, and I cant get why, I do all like described here, and browser opens when I tun grunt, then when change index.html
, in console getting
Waiting...
>> File "index.html" changed.
Completed in 0.000s at Wed Jun 03 2015 11:45:24 GMT+0300 (EEST) - Waiting...
>> File "index.html" changed.
Completed in 0.000s at Wed Jun 03 2015 11:54:11 GMT+0300 (EEST) - Waiting...
>> File "index.html" changed.
Completed in 0.000s at Wed Jun 03 2015 12:01:30 GMT+0300 (EEST) - Waiting...
but browser not reloading, what I am doing wrong? Maybe I miss something? I trying to Googling problem but didnt get any helpful results... If you need my Gruntfile or any, just say to me. Thanks!
Here is my Gruntfile.js :
module.exports = function(grunt) {
// Load Grunt tasks declared in the package.json file
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Configure Grunt
grunt.initConfig({
// Grunt express - our webserver
// https://github.com/blai/grunt-express
express: {
all: {
options: {
bases: ['var\\www\\megapolis'],
port: 8080,
hostname: "localhost",
livereload: true
}
}
},
// grunt-watch will monitor the projects files
// https://github.com/gruntjs/grunt-contrib-watch
watch: {
all: {
files: '**/*.html',
options: {
livereload: true
}
}
},
// grunt-open will open your browser at the project's URL
// https://www.npmjs.org/package/grunt-open
open: {
all: {
path: 'http://localhost/megapolis/index.html'
}
}
});
// Creates the `server` task
grunt.registerTask('server', [
'express',
'open',
'watch'
]);
};