Coder Social home page Coder Social logo

grunt-concurrent's Introduction

grunt-concurrent Build Status

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 nodemon and watch at once.

Install

$ npm install --save-dev grunt-concurrent

Usage

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

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 2

Limit 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 to launch and monitor a node server and grunt-contrib-watch to watch for asset changes all in one terminal tab:

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.

grunt-concurrent's People

Contributors

arthurvr avatar baer avatar chriswren avatar diogoriba avatar fatfisz avatar jimf avatar kerrychen95 avatar kimjoar avatar mbuchetics avatar shingyx avatar sindresorhus avatar wkwiatek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.