Creating a New Grunt Project
Grunt – Getting Started documentation from the grunt website is the obvious place to start.
Brian Chu’s Grunt by Example tutorial and Justin McCandless’s Tutorial for Getting Started on Grunt further expand and explain the steps involved.
Overview of Basic Steps
These are the basic steps involved. The other resources listed in this post detail the creation and installation of any required files.
- Install the Grunt CLI globally: so the
gruntcommand exists within system path allowing it to be run from any directory.
- Prepare a new Grunt project: add the following two files to the root of the project for which to run the automation tasks (detailed within any of the resources listed here):
- package.json – list grunt and the Grunt plugins.
- Gruntfile.js – configure or define tasks and load Grunt plugins.
- Install plugins for the project:
- Add plugins to package.json and Gruntfile.js (detailed within any of the resources listed here).
- Run Grunt:
gruntto run all the tasks for the project
- or follow it with an individual task to run only that task e.g
- Merrick Christensen – Grunt.js Workflow
- Sitepoint – Writing an Awesome Build Script with Grunt
- Smashing Magazine – Getting Up and Running with Grunt
- Treehouse – Getting Started with Grunt
- Sitepoint – Automate recurring tasks with Grunt (added 19th May 2014)