- Add cookie option for tasks /config/watch.js
module.exports = function(grunt) { grunt.config.set('watch', { api: {
- Add a script cookie to your layout, somewhere at the end before the
</body> , by default views / layout.ejs:
<script src="http://localhost:35729/livereload.js"></script>
With the exception of the local host, you can use the IP or DNS name of the server
This will refresh the page if the file is modified in the api or assets folder.
By default, Ggrunt-contrib-watch uses port 35729 . You can specify a different port, for example livereload: 8000
EDIT: Well, I really don't know if this is completely true, but it looks like you can override the layout settings in config/env/development.js . Add something like:
module.exports = { views: { layout: 'dev' } }
Then you can create a separate views/dev.ejs layout file in which you can add a script cookie and other development options. You can also add the livereload key in the same way.
source share