A grunt task that enables live reloading of updated watch files in the browser.
A task and reverse proxy that enables live reloading in the browser.
Install this grunt plugin next to your project's grunt.js gruntfile with:
npm install grunt-reload
Then add this line to your project's
This plugin provides two grunt tasks: 'reload' and 'reloadServer'. 'reload' is designed to be called via the watch task configuration. 'reloadServer' is designed to be called on the command-line along with the watch task.
The reload task tells the page to refresh itself via websocket connection between the reloadServer task and the reloadClient.js that is appended to the requested html file. When the watch task detects a changed file, it will process its configured tasks, which should include the 'reload' task if it is setup like the example below.
Here's how you would use grunt-reload with grunt-less:
// project configurationgruntinitConfiglint:all:'js/*.js'reload:port: 6001proxy:host: 'localhost'watch:files:'index.html' 'style.less'tasks:'default reload';gruntloadNpmTasks'grunt-less';gruntloadNpmTasks'grunt-reload';gruntregisterTask'default' 'lint less';
grunt reloadServer watch
05/27/2012 - 0.1.0: Initial release.
Copyright (c) 2012 webxl
Licensed under the MIT license.