Chapter 3. Using Grunt

Now that we've installed and configured Grunt, we're ready to use it. In this chapter, we'll review creating our own tasks and cover the finer points omitted in previous chapters. We shall also cover the various methods of executing tasks over and above simply running Grunt on the command-line. Finally, we will cover how to choose the most appropriate tasks for the job and exactly how to integrate them into our Grunt build.

Creating your own tasks

In this section, we shall explore the creation of Grunt tasks in more detail, specifically normal tasks and multitasks, and asynchronous tasks.

Tasks

As exemplified previously, creating tasks is extremely simple. We provide a name and a function to grunt.registerTask and we're ready ...

Get Getting Started with Grunt: The JavaScript Task Runner 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.