Answer the question
In order to leave comments, you need to log in
Gulp, how to execute 2 tasks without intermediate write to disk?
Good afternoon!
Since writing to disk is a time-consuming task. I would like to speed up the execution, due to the flow, but it does not occur to me how this can be done in 1 pass (task). Help out :)
gulp.task('coffee', function() {
return 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) // libsJS включает в себя и файл записанный на диск в таске coffee
.pipe(concat('all.js'))
.pipe(gulp.dest(paths.build.scripts));
});
Answer the question
In order to leave comments, you need to log in
ANSWER :
As an option, there is: event-stream
Or gulp-if:
gulp.task('scripts', function() {
gulp.src(paths.src.scripts)
.pipe(gulpif(/[.]coffee$/, coffee()))
.pipe(concat('all.js'))
.pipe(gulp.dest(paths.build.scripts));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question