gulp-sequence
Run a series of gulp tasks in order.
Install
Install with npm
npm install --save-dev gulp-sequence
Usage
var gulp = require('gulp')
var gulpSequence = require('gulp-sequence')
gulp.task('a', function (cb) {
})
gulp.task('b', function (cb) {
})
gulp.task('c', function (cb) {
})
gulp.task('d', function (cb) {
})
gulp.task('e', function (cb) {
})
gulp.task('f', function () {
return gulp.src('*.js')
})
gulp.task('sequence-1', gulpSequence(['a', 'b'], 'c', ['d', 'e'], 'f'))
gulp.task('sequence-2', function (cb) {
gulpSequence(['a', 'b'], 'c', ['d', 'e'], 'f', cb)
})
gulp.task('sequence-3', function (cb) {
gulpSequence(['a', 'b'], 'c', ['d', 'e'], 'f')(cb)
})
gulp.task('gulp-sequence', gulpSequence('sequence-1', 'sequence-2', 'sequence-3'))
with gulp.watch
:
gulp.watch('src/**/*.js', function (event) {
gulpSequence('a', 'b')(function (err) {
if (err) console.log(err)
})
})
API
var gulpSequence = require('gulp-sequence')
gulpSequence('subtask1', 'subtask2',...[, callback])
return a thunk function.
var gulp = require('gulp')
var gulpSequence = require('gulp-sequence')
gulp.task('test', gulpSequence(['a', 'b'], 'c', ['d', 'e'], 'f'))
gulpSequence.use(gulp)
return a new gulpSequence function with the gulp. If you have some errors such as "task xxx is not defined", this will resolve it.
var gulp = require('gulp')
var gulpSequence = require('gulp-sequence').use(gulp)
gulp.task('test', gulpSequence(['a', 'b'], 'c', ['d', 'e'], 'f'))
License
MIT © Teambition