Answer the question
In order to leave comments, you need to log in
Problem with node, gulp asynchrony - tasks?
Good afternoon!
Faced the problem of node asynchrony and I don’t understand how to deal with it.
While it used to work as it should.
As far as I know, when executing tasks, if a node lingers on one of them, then it moves on, creating asynchronous execution.
Here are 2 tasks. The first of them must be executed, and then only the second. Since the first one creates a compiled file by writing to the tmp folder.
Perhaps you can tell me how to do without writing to tmp, but make it a stream.
My experience with gulp does not allow me to come up with something that does not greatly complicate the logic:
gulp.task('coffee', function () {
gulp.src(paths.src.coffee)
.pipe(coffee())
.pipe(concat('buildCoffee.js'))
.pipe(gulp.dest(paths.build.tmp));
});
gulp.task('scripts', ['coffee'], function () {
gulp.src(paths.src.libsJS)
.pipe(concat('all.js'))
.pipe(gulp.dest(paths.build.scripts));
});
Answer the question
In order to leave comments, you need to log in
Try adding return to gulp.src(paths.src.coffee)
gulp.task('coffee', function () {
return gulp.src(paths.src.coffee)
.pipe(coffee())
.pipe(concat('buildCoffee.js'))
.pipe(gulp.dest(paths.build.tmp));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question