Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/grunt-concurrent
Run grunt tasks concurrently
https://github.com/sindresorhus/grunt-concurrent
Last synced: about 2 months ago
JSON representation
Run grunt tasks concurrently
- Host: GitHub
- URL: https://github.com/sindresorhus/grunt-concurrent
- Owner: sindresorhus
- License: mit
- Created: 2013-04-07T12:17:33.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2023-08-31T16:09:23.000Z (about 1 year ago)
- Last Synced: 2024-04-14T10:28:25.165Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 798
- Watchers: 16
- Forks: 70
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
- Security: .github/security.md
Awesome Lists containing this project
README
# grunt-concurrent
> 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](#logconcurrentoutput) like `nodemon` and `watch` at once.
## Install
```sh
npm install --save-dev grunt-concurrent
```## Usage
```js
require('load-grunt-tasks')(grunt);grunt.initConfig({
concurrent: {
target1: ['coffee', 'sass'],
target2: ['jshint', 'mocha']
}
});// Tasks of target1 run concurrently, after they all finished, tasks of target2 run concurrently, instead of target1 and target2 running concurrently.
grunt.registerTask('default', ['concurrent:target1', 'concurrent:target2']);
```## Sequential tasks in concurrent target
```js
grunt.initConfig({
concurrent: {
target: [['jshint', 'coffee'], 'sass']
}
});
```Now `jshint` will always be done before `coffee` and `sass` runs independent of both of them.
## Options
### limit
Type: `number`\
Default: Twice the number of CPU cores with a minimum of 2Limit how many tasks that are run concurrently.
### logConcurrentOutput
Type: `boolean`\
Default: `false`You can optionally log the output of your concurrent tasks by specifying the `logConcurrentOutput` option. Here is an example config which runs [grunt-nodemon](https://github.com/ChrisWren/grunt-nodemon) to launch and monitor a node server and [grunt-contrib-watch](https://github.com/gruntjs/grunt-contrib-watch) to watch for asset changes all in one terminal tab:
```js
grunt.initConfig({
concurrent: {
target: {
tasks: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true
}
}
}
});grunt.loadNpmTasks('grunt-concurrent');
grunt.registerTask('default', ['concurrent:target']);
```*The output will be messy when combining certain tasks. This option is best used with tasks that don't exit like `watch` and `nodemon` to monitor the output of long-running concurrent tasks.*
### indent
Type: `boolean`\
Default: `true`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.