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

Adding the concurrent task


The concurrent task enables you to run several tasks concurrently. This is particularly useful when working with tasks such as the connect or watch task that stay active and block the tasks after them.

In this recipe, you will learn how to use the concurrent plugin to run the connect, open, and watch tasks at the same time. This will allow you to run one command to start the server and automatically open the browser window and watch the files for changes to reload the browser as you save any of the files.

Getting ready

The only requirement for this recipe is to have the concurrent plugin installed and loaded in your Gruntfile.js file. If you have not installed this plugin in the Installing Grunt plugins recipe of this chapter, you can do this using the following command in the root of your project:

$ npm install grunt-concurrent --save-dev

How to do it…

Add the following configuration for the concurrent task to the Gruntfile.js file after the open task:

open: {
   ...