browserify / watchify

watch mode for browserify builds
Other
1.79k stars 181 forks source link

Fix to #56 #146

Open simonzack opened 9 years ago

simonzack commented 9 years ago

Add/remove is done by calling the constructor, which retains the caches so builds remain fast.

I took this approach, since from my reading of the code, reset() needs to be called somewhere first in the chokidar handler so the pipeline can be modified, since bundle() was called previously.

If there's a better way please let me know and I'll update the PR.

zertosh commented 9 years ago

@simonzack The use case for this (according to https://github.com/substack/watchify/issues/56) is for when you use watchify via the command-line. How about if in bin/cmd.js you handle the tearing down the previous watchify->browserify instance and spinning up a new one on add/unlink whatever?

simonzack commented 9 years ago

@zertosh Well, my implementation keeps the cache. My own use case was for gulp, but you're right that this perhaps is only half the fix, as it doesn't yet address the cmd issue.