Grunt Demo
- Requires Node.js
- There are various ways to install Node.js. See the following for suggestions:
- https://nodejs.org/
- http://www.nearform.com/nodecrunch/nodejs-sudo-free/
- http://benznext.com/completely-uninstall-node-js-from-mac-os-x/
- http://treehouse.github.io/installation-guides/mac/node-mac.html
- Run the following commands from your project folder:
npm init
- Initializes and creates thepackage.json
filenpm install grunt --save-dev
- Installs Grunt and adds configuration to thepackage.json
filenpm install grunt-contrib-uglify --save-dev
- Minify JavaScript filesnpm install grunt-contrib-watch --save-dev
- Watch for file system changesnpm install grunt-sass --save-dev
- Compile Sass files- Configure
gruntfile.js
(see thegruntfile.js
for an example) - Run
grunt watch
to watch for changes,grunt build
to build for production, orgrunt
to build for development
Original reference: http://teamtreehouse.com/library/up-and-running-with-grunt