Reputation: 75
i have a noob question about livereload with Grunt. I have the watch task configured with livereload: true I added the tag at the bottom of the page and when i point the browser to localhost:port_number_i_can't_remember it shows a page with the .js server i guess...
how can i use livereload to reload the html i'm working on. where do i have to point the browser? I'm using sublime3 and added the livereload package. I also use brackets, been on/off between the two.
The grunt file:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
includePaths: ['sass/**/*.scss']
},
dist: {
options: {
outputStyle: 'compressed',
sourceMap: true
},
files: {
'css/materialize.css': 'sass/materialize.scss'
}
}
},
watch: {
grunt: {
options: {
livereload: true
},
files: [
'css/*.css',
'*.html'
]
},
sass: {
files: 'sass/**/*.scss',
tasks: ['sass']
},
}
});
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('build', ['sass']);
grunt.registerTask('default', ['build', 'watch']);
}
What am i doing wrong here guys?
Upvotes: 0
Views: 329
Reputation: 7360
There are several ways to enable it, and they're listed in the official wiki.
The easiest is the first one, include
<script src="//localhost:35729/livereload.js"></script>
before </body>
in your HTML page.
If you have any question on one of these methods, please update the question accordingly
Upvotes: 1