Run grunt tasks concurrently
Running slow tasks like Coffee and Sass concurrently can potentially improve your build time significantly. This task is also useful if you need to run multiple blocking tasks like
watch at once.
$ npm install --save-dev grunt-concurrent
grunt;grunt;// Tasks of target1 run concurrently, after they all finished, tasks of target2 run concurrently, instead of target1 and target2 running concurrently.grunt;
Sequential tasks in concurrent target
jshint will always be done before
sass runs independent of both of them.
Default: Twice the number of CPU cores with a minimum of 2
Limit how many tasks that are run concurrently.
You can optionally log the output of your concurrent tasks by specifying the
logConcurrentOutput option. Here is an example config which runs grunt-nodemon to launch and monitor a node server and grunt-contrib-watch to watch for asset changes all in one terminal tab:
The output will be messy when combining certain tasks. This option is best used with tasks that don't exit like
nodemon to monitor the output of long-running concurrent tasks.
You can optionally skip indenting the log output of your concurrent tasks by specifying
false. This can be useful for running tasks in parallel for a stdout parser which expects no indentation, for example, TeamCity tests.