---
title: "Live Reload With Grunt"
description: "Sometime back I had published an entry on Node Packing with grunt but live reload has been so fascinating to most of the."
url: "https://h3manth.com/scribe/live-reload-grunt/"
canonical_url: "https://h3manth.com/scribe/live-reload-grunt/"
markdown_url: "https://h3manth.com/scribe/blog/live-reload-grunt.md"
publishDate: "2012-12-15T00:00:00.000Z"
author: "Hemanth HM"
category: "javascript"
tags: ["nodejs","web"]
word_count: 158
reading_time_minutes: 1
x_markdown_tokens: 425
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Live Reload With Grunt

> Sometime back I had published an entry on Node Packing with grunt but live reload has been so fascinating to most of the.

Sometime back I had published an entry on [Node Packing with grunt](http://h3manth.com/content/node-packing-made-easy-grunt) but live reload has been so fascinating to most of the webdevs, it would be worth to make your own tiny server that reloads files as and when it gets edited.

Check out the video [DEMO](http://www.youtube.com/watch?v=ycwdgm5VJRI) and then read the steps below:

  * Install grunt and grunt-reload : `npm install -g grunt grunt-reload`

**The grunt.js:**

module.exports = function (grunt) {
    
    
    'use strict';
    
    //initialize grunt with config
    grunt.initConfig({
        //configure grunt-reload
        reload: {
            port: 1337, // LR Port
            liveReload: {},
            proxy: {
                host: 'localhost'
            }
        },
        trigger: {
            watchFile: 'index.html'
        },
        server: {
            port: 8000,
            base: '/labs'
        },
        watch: {
            files: ['/labs/*.html'],
            tasks: 'reload'
        }
    });
    
    //Load the extra tasks from our npm modules
    grunt.loadNpmTasks('grunt-reload');
    grunt.registerTask("run", "server reload watch");
    

}; 

To start the task just say : `$grunt run` and have fun!

P.S : grunt-contrib-reload is anyway better, but this is just the raw way of doing it.
