Using Grunt For Live Reload Revisited

You might also want to check out Yeoman. Once it is installed you
install the generator with npm install -g generator-webapp
Then in your new folder just type yo webapp and it sets all that
stuff up for you.
From there you just type grunt server and you're golden.

I was curious to try this and see what it did differently so I installed Yeoman, followed Dan's instructions, and had a test site setup in a few minutes.

Looking at the package.json file this setups up a LOT more than I had in my original demo. You may not need all of it depending on what you are working on but it's interesting to see how it's automatically configured...

One thing I noticed right away was that using Connect was much less resource intensive than Express. As I mentioned in my previous post using Express I'd see CPU usage spike well over 50% (on Windows). Using Connect it averages below 20%.

The rest of the stuff is for minimizing code, renaming files, jshinting, etc.

But lets see if we can strip it down to the basics of my original demo...

First we'll remove the bits we don't need in package.json:

First I created a new directory and copied over a few files from this one:

Gruntfile.js

package.json

\app\index.html

I then edited the package.json files to remove everything we don't need: