Gulp v3
Use obsolete but still working gulp.run
gulp.task('foo', ...)
gulp.task('bar', function () {
if (something) {
gulp.run('foo')
}
})
, , run-sequence ( , , ). (Gulp v3):
gulp.task('bar', (callback) => {
if (something) {
runSequence('foo', callback)
} else {
runSequence('foo', 'anotherTask', callback)
}
})
Gulp v4
gulpfile
, gulpfile.babel.js
, Gulp , :
export function foo () {
...
}
export function bar () {
if (something) {
foo()
}
}