browserify / factor-bundle

factor browser-pack bundles into common shared bundles
Other
402 stars 27 forks source link

support callback outputs #73

Closed zoubin closed 9 years ago

zoubin commented 9 years ago

I was trying to use watchify + factor-bundle + gulp, and it didn't work because the output streams ended before reset, and thus not writable.

I searched the issues, and found https://github.com/substack/factor-bundle/pull/25. There is a nice solution for factor-bundle with gulp, but watchify still the problem.

So, here is my solution. I am not quite sure it is the right way, but it seems to work.

Perhaps the outputs can be generated each time addHooks run to make sure writable outputs. As the outputs element could be streams, they should also be reconstructed, and factor-bundle lacks that information right now. So, here comes the callback outputs .

Here is an example: https://github.com/zoubin/watchify-factor-bundle-gulp