gulp-flatMap icon indicating copy to clipboard operation
gulp-flatMap copied to clipboard

Processing too many folders cause freezing gulp task

Open e-g1gor opened this issue 6 years ago • 3 comments

Gulp says "task didnt complete" when i tried to process more than 22 folders with flatmap:

  gulp.src(app.blocks) //more than 22 folders
  .pipe(flatmap((stream, file) => {
    return stream;
  }))

Detail description here: https://stackoverflow.com/q/49394845/9525161

e-g1gor avatar Mar 21 '18 14:03 e-g1gor

Hmm, from the SO discussion this looks like it's a problem in Gulp 4, which I unfortunately haven't tested it in. Might be something ha changed that causes it to not work anymore.

But, why don't you return the stream from the function? As in, return gulp.src().....

Also, from the full code in SO it looks like you don't need this plugin, as you don't map each file in the stream into multiple files. In general, if you don't use the stream inside the function, then you don't need gulp-flatmap. I would suggest you try with gulp-tap instead

mariusGundersen avatar Mar 21 '18 14:03 mariusGundersen

Well, i really don't need flatmap for this particular task, just was too lazy to change the code. I've tried return gulp.src(), with the same effect. Now i use glob, i just wanted to let you know there might be bug or something.

e-g1gor avatar Mar 21 '18 14:03 e-g1gor

Thanks for letting me know, I will look into it :+1:

mariusGundersen avatar Mar 21 '18 19:03 mariusGundersen