gulp-adhoc
is designed to allow easy composition of sequential and parallel tasks via the command line.
NOTE: This module depends on run-sequence
, which is a temporary solution while the new task system is in development. gulp-adhoc
will either adapt to the new order (if useful), or be retired.
Just require gulp-adhoc
at the top of your gulpfile, passing it your gulp instance.
var gulp = require('gulp');
var gutil = require('gulp-util');
var runs = require('run-sequence');
require('gulp-adhoc')(gulp, gutil.env);
# Simple sequence
gulp clean,build,test,deploy
# Sequence with parallel sections
gulp clean,[coffee,less,jade],[min-css,min-js,min-img],inject
If you find yourself using the same ad hoc commands repeatedly, you can promote them to tasks like this...
var gulp = require('gulp');
var gutil = require('gulp-util');
var runs = require('run-sequence');
gulp.task('do-the-thing', function(done) {
runs(
'clean',
['coffee','less','jade'],
['min-css','min-js','min-img'],
'inject',
done);
});