substack/node-browserify — pull request #608 by tonistiigi (2014-01-27 20:42:26+00:00)
Title: Emit close event on bundle stream with standalone

Currently `watchify` does not work with `standalone` option because the bundle stream does not emit `close` event.

When `this.queue(null)` is called `through` emits `end` event but because the stream is also writable it does not get destroyed. Other way to fix it would be to set `output.writable = false`.

The test got a bit hacky because when `bundle()` is called before `_ready` event the bug does not appear because it gets wrapped into another `through` stream.