admin管理员组文章数量:1317909
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?
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?
1 Answer
Reset to default 8You 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
本文标签: javascriptHow to concatenate two streams using gulpStack Overflow
版权声明:本文标题:javascript - How to concatenate two streams using gulp? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742010904a2412864.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论