Gruntfile.js

To set up Grunt for your project, you need to create a new JavaScript file called Gruntfile.js in your kittenbook directory. Gruntfile.js is used to tell Grunt what to automate and how. The structure of Gruntfile.js is strict and well defined. We start with the basic structure in Listing 4.3 and then fill in the specifics.

Listing 4.3 Basic Gruntfile.js Structure

module.exports = funciton(grunt){    // Project configuration    grunt.initConfig({      /*       * We will configure our tasks here       */    });    // We will load Grunt plugins here    // We will register tasks here};

The most important thing in our Gruntfile is grunt.initConfig. This is where you configure each of your tasks. Other parts ...

Get Learning to Program now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.