I'm using Laravel as my back-end framework, I would like to have live reloading when some file's modification occurs. I still don't successfully configure the Gruntfile.js to make it works.
I think, I should need 2 plugins, grunt-contrib-watch and grunt-contrib-connect, and I have configured Grutnfile.js as follow.
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
options: {
livereload: true
},
page: {
files: ['*.php', '*.html'],
tasks: ['connect']
}
},
connect: {
options: {
port: 8000,
protocol: 'http',
hostname: '*',
livereload: true
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('do-server', ['watch']);
grunt.registerTask('do-connect', ['connect']);
};
Please help me to get things right, when things get right, I only have to run as grunt do-connect then grunt will launch the browser for me or I have to open browser and browser to the specified ports manually???
Thanks.