Adding a configuration definition for a plugin
Any Grunt task needs a configuration definition. The configuration definitions are usually added to the Gruntfile.js
file itself and are very easy to set up. In addition, it is very convenient to define and work with them because they are all written in the JSON format. This makes it very easy to spot the configurations in the plugin's documentation examples and add them to your Gruntfile.js
file.
In this recipe, you will learn how to add the configuration for a Grunt task.
Getting ready
For this recipe, you will first need to create a basic Gruntfile.js
file and install the plugin you want to configure. If you want to install the grunt-example plugin, you can install it using the following command in the root of your project:
npm install grunt-example --save-dev
How to do it...
Once you have created the basic Gruntfile.js
file (also refer to the Utilizing the Gruntfile.js file recipe of this chapter), follow this step:
- A simple form of the...