P
P
Peter2016-01-22 19:30:02
gulp.js
Peter, 2016-01-22 19:30:02

How to run tasks synchronously in Gulp?

There are solutions on the Internet when one task does not start without waiting for another.
For example

gulp.task('default', ['sync', 'thirdTask'], function () {  
    // делаем всякое
});

There is also a gulp-sequence module for gulp , but not everything is as we would like with it. If it is present in several tasks as in the example
var gulpSequence = require('gulp-sequence');
gulp.task('default-one', gulpSequence('task-one', ['some-tesk', 'task-fff'], 'task-css'));
gulp.task('default-two', gulpSequence('task-js', 'task-css', 'task-dev'));

then when default-two is started, default-one is also started. (for a long time swearing the reasons did not understand why this happens).
In general, we need an alternative to gulp-sequence, so that several tasks can be launched synchronously (from the beginning three, then one, then five more).
Are there any options to solve my problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Strukov, 2016-01-22
@pm_wanderer

The first option is the most adequate, I think
you do a task with dependencies in an array and then you insert this task into another array of dependencies and configure the order as needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question