For example I have a task with next content:
function task() {
gulp.src('libs/*.js')
// some manipulations
.concat('libs.js')
gulp.src('js/*.js')
// Another manipulations
.concat('app.js')
}
What if I don't want to put this files anywhere in file system? Can I somehow concatenate libs.js
and app.js
inside a task?
You can use merge-stream package. Simple example:
gulp.task("do-something", function() {
var vendorScripts1 = gulp.src("libs/*.js")
.pipe(/* I want to do something*/));
var vendorScripts2 = gulp.src("js/*.js")
.pipe(/* I want to do something else here*/);
return merge(vendorScripts1 , vendorScripts2)
.pipe(/*bla bla bla*/);
});
Github example
I hope it will help you.
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With