Book Image

LESS WEB DEVELOPMENT COOKBOOK

Book Image

LESS WEB DEVELOPMENT COOKBOOK

Overview of this book

Table of Contents (19 chapters)
Less Web Development Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 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 Grunt file, follow these steps:

  1. A simple form of the task configuration is shown in the following code. Start by adding it to your Gruntfile.js...