Register Tasks

Finally, we need to register some tasks to be run. This step isn’t entirely necessary, but it’s like icing on the cake. You can already run the concat, copy, and jshint tasks individually. Open the command line, navigate to the kittenbook directory, and type grunt jshint (see Figure 4.8).

Image

Figure 4.8 Run grunt jshint, and it works!

It works, and so do concat and copy, but we don’t want to have to run each of them separately: That would only be a little better than no Grunt at all. Grunt allows you to register a task that will run a list of other tasks in order, using grunt.registerTask. We will register one task, called default ...

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.