gulp
gulp copied to clipboard
Gulp with 2 async operations depending on each other
In Generating a file per folder tutorial (https://github.com/gulpjs/gulp/blob/master/docs/recipes/running-task-steps-per-folder.md)
I think the last line return merge(tasks, root); is wrong.
root is a stream depending on tasks. Hence, main.js and main.min.js are not generated because merge runs these 2 async operations in parallel (https://github.com/dominictarr/event-stream#merge-stream1streamn-or-merge-streamarray, "no ordering will be applied").
Something like .on('end', cb) should be used in my opinion with cb being the root function
those 2 streams aren't meant to rely on each other.