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

Utilizing the Gruntfile.js file


The Gruntfile.js file is the main configuration file for Grunt that handles all the tasks and task configurations. All the tasks and plugins are loaded using this file. In this recipe, you will create this file and will learn how to load Grunt plugins using it.

Getting ready

First, you need to install Node and Grunt as described in the Installing Node and Grunt recipe of this chapter. You will also have to install some Grunt plugins as described in the Installing Grunt plugins recipe of this chapter.

How to do it…

Once you have installed Node and Grunt, follow these steps:

  1. In your Grunt project directory (the folder that contains the package.json file), make a file, save it as Gruntfile.js, and add the following lines to it:

    module.exports = function(grunt) {
          grunt.initConfig({
                  pkg: grunt.file.readJSON('package.json'),
                  app: {
                           dev: 'app/dev'
                  },
        //Add the Tasks configurations here.
      });
     ...