021 Gruntjs

09 Nov 2012

GruntJS is tool task-based command line build tool for JavaScript projects. Automate your build tasks like concatenation, minification, linting, testing and many others with some simple configuration or even with some nifty GruntJS plugins!

Download video: mp4

Sample code: Github

Version: 0.3.17

Similar episodes: 009 Package Managers

Background on grunt.js:

  1. Grunt.js homepage and what is a build tool
  2. Grunt.js documentation
  3. Meet Grunt: The Build Tool for JavaScript
  4. Grunt: A command line Tool
  5. introducing grunt by bocoup
  6. node package manager (npm)

Things to learn with grunt.js

1. check pre-requisites:

In the command line::

  1. check that node package manager is installed: npm -v
  2. install grunt globally with npm: sudo npm install -g grunt
  3. check that grunt is successfully installed and check the version: npm info -g grunt or just grunt --version
  4. for more info, use grunt --help
  5. find grunt plugins npm find gruntplugin

2. run grunt

  1. run grunt init:gruntfile and answer the questions
  2. a grunt.js file will be created
  3. if you want to run testing with qunit, install phantomjs
    • unzip or git clone
    • move phantomjs/bin/phantomjs to typically /usr/local/bin
  4. run grunt

More Resources on build tools

  1. what is a build tool
  2. gnu make
  3. ruby rake

Build Link of this Episode

Distilled Hype, premium links for front-end developers, distilled from the latest hype by @hellokahlil