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 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.
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