Use Grunt Plug-ins

Without plug-ins, Grunt doesn’t do anything. You need plug-ins to automate all your build tasks. We will be using grunt-contrib-concat, grunt-contrib-copy, and grunt-contrib-jshint (Grunt plug-ins with the grunt-contrib prefix are written and maintained by the same people who write and maintain Grunt), which we already added to our package.json and installed using npm install. Now we need to load them into Grunt and configure them (see Listing 4.4).

Listing 4.4 Complete Gruntfile.js for kittenbook

module.exports = function(grunt) {    grunt.initConfig({      concat: {        release: {          src: ['js/values.js', 'js/prompt.js'],          dest: 'release/main.js'        }      },      copy: ...

Get Learning to Program now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.