Book Image

Learning Grunt

By : Douglas Reynolds
Book Image

Learning Grunt

By: Douglas Reynolds

Overview of this book

With the increasing focus on task automation, the Grunt task runner is a vast platform that allows you to incorporate automation into your workflows. At the outset, you will learn how to use Node.js and NMP through an example. You will then find out how to build a sample app and the development environment for it. You will further delve into the implementation of Grunt plugins and the configuration of Grunt tasks. Furthermore, you will explore the various methods and packages for workflow automation. The final chapter will cover some advanced concepts, such as configuration variables and how to create a Grunt plugin. By the end of the book, you will have gained the fundamentals of Grunt and progressed through advanced concepts, including building a Grunt plugin.
Table of Contents (15 chapters)

Reviewing the installation of Grunt tasks


In each task that was outlined in Chapter 3, All about Grunt Plugins there was a distinctly common thread that existed between all of the plugins: the installation process. Installation of plugins is accomplished through Terminal or command line, and the syntax is very simple. As previously described, here is the common format of the task installation syntax for grunt plugins:

npm install [package name] --save-dev

The npm install command invokes the installation of a package, [package name]. Additionally, this command has an optional flag, -save-dev, which instructs the installer to save the package as a development dependency. Plugins saved as devDependencies are saved locally to the project and registered in the package.json file in the devDependencies configuration section. The plugin itself, when installed as a devDependencies configuration, will be located in your project's node-modules directory. In this section, we will be installing plugins...