teambition / merge2

Merge multiple streams into one stream in sequence or parallel (~119M/month downloads).
MIT License
170 stars 14 forks source link

Stream errors in merge2 1.2.0 #17

Closed donker closed 6 years ago

donker commented 6 years ago

I've been struggling with this for a few hours now. I've started a new project and using Gulp 3.9.1 and merge2 1.2.0 my old build scripts are failing because gulp.src doesn't seem to return correct streams to merge.

merge(
 gulp.src(['*.txt'], {base: '.'})
 .pipe(debug({ title: 'txtfiles:' })),
 gulp.src(['*.css'], {base: '.'})
 .pipe(debug({ title: 'cssfiles:' }))
)
.pipe(debug({ title: 'merge:' }))
.pipe(zip('myzip.zip'))

I'm getting all css files double (i.e. I'm getting css files from the txt files stream as well as the css stream) and in the zip file you'll find double entries. Then if one of the streams returns no files (let's say change to '*.foobar') then all streams return 0 files.

donker commented 6 years ago

It had to do with another component: gulp-filter. This caused the bleeding of one stream into another. Sorry if I wasted anyone's time.