As written on Grunt JS…
“Why use a task runner?
In one word: automation. The less work you have to do when performing repetitive tasks like minification, compilation, unit testing, linting, etc, the easier your job becomes. After you’ve configured it, a task runner can do most of that mundane work for you—and your team—with basically zero effort.”
“Why use Grunt?
The Grunt ecosystem is huge and it’s growing every day. With literally hundreds of plugins to choose from, you can use Grunt to automate just about anything with a minimum of effort. If someone hasn’t already built what you need, authoring and publishing your own Grunt plugin to npm is a breeze.”
Now to start using Grunt, follow the steps on the ‘Getting started’ page.
In your Terminal / Command Line, type:
(sudo) npm install -g grunt-cli
(Use sudo if you’re on a Mac.)
Once you’ve installed Grunt, I am assuming you’ll be using my ‘Grunt Boilerplate‘ as your project? So therefore we’ll be working on an existing project. So to run Grunt, do the following (as described by Grunt):
In your Terminal / Command Line:
- Navigate to your projects’ root directory.
– this will install the project dependencies.
– to run Grunt
There are two important files when using Grunt and they are:
- package.json – This file lists grunt and the Grunt plugins that the project needs as devDependencies.
- Gruntfile.js – This file is used to configure, define tasks and load Grunt plugins.
For more information on each Grunt plugin listed (and what they do in this boilerplate), read the following links:
Tada! you should now be up and running using Grunt!
More about this Grunt Boilerplate
It’s a simplified version of Chris Coyiers’ Grunt Boilerplate based on the CSS Tricks screencast First Moments with Grunt which also accompanies the article written by Chris, Grunt for People Who Think Things Like Grunt are Weird and Hard.
Using this Grunt Boilerplate in Git
Clone the repository (using either HTTPS, SSH or Subversion):
git clone email@example.com:adelineyaw/GruntBoilerplate.git
Run the npm install: