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 .
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 timeaddHooks
run to make sure writable outputs. As theoutputs
element could be streams, they should also be reconstructed, and factor-bundle lacks that information right now. So, here comes thecallback outputs
.Here is an example: https://github.com/zoubin/watchify-factor-bundle-gulp