Wait until there is some data before creating the output stream in the CLI #245
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
An earlier attempt at this was 8168edf, which added a flag
--write-on-donethat waited until the entire bundle was done before beginning to write.The current approach is better because it has the best of both worlds. It starts to write when data is actually available, but doesn't buffer everything. module-deps is the slowest part of the pipeline, however, it's actually deps-sort that causes the bottleneck – since it has to wait until all the rows are done before it can sort them.
This waits until browser-pack has something to be read before opening the write stream. This prevents issues with bundles that have a long processing time (mostly in module-deps), where you'd have 0 byte output file for a while before anything actually gets written to it.
Fixes #239 and #272