Grunt.js

The JavaScript Task Runner






Rocky Jaiswal
Jul 2013

Why use Grunt





Automation*

Most popular option

Great plugins available

Installation






npm install -g grunt-cli

Running Grunt



Needs -


  • package.json
  • Gruntfile.js / .coffee

package.json



 {
  "name": "my-project-name",
  "version": "0.1.0",
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-jshint": "~0.6.0",
    "grunt-contrib-nodeunit": "~0.2.0",
    "grunt-contrib-uglify": "~0.2.2"
  }
}

Gruntfile




A Gruntfile is comprised of the following parts:
  • The "wrapper" function
  • Project and task configuration
  • Loading grunt plugins and tasks
  • Custom tasks

Simple Example



A small static webapp I am building

I want to use SASS and CoffeeScript

Demo



Improve it more



THE AWESOME

grunt-contrib-watch

Using it with Yeoman




Demo






Thank You

Grunt.js

By rockyj

Grunt.js

  • 1,907