Closed tugend closed 9 years ago
That's how the cache works. Only the file that changes gets invalidated and reprocessed - the rest are pulled from the cache. And only those files are that explicitly referenced by the build are monitored. So adding or deleting a file that nothing references doesn't do anything.
Considering how watchify is often used I would claim it practical if it supported add/remove of files in this intuitive manner. As far as I know (I may be mistaken), it would be entirely possible to monitor for files added or removed within a given folder - and respectively update the cache such that deleted files are invalidated in the cache and added files are added to the list of monitored files.
Regardless I appriciate your reply, thank you.
Hey @tugend, I'm currently exploring a move to that model in https://github.com/substack/watchify/issues/210. The main issue right now, is figuring out what folder to watch exactly. Finding the lowest common dir for a "bundle" is actually kinda weird for these purposes because it's not a value you give browserify. You'd think that the most obvious choice would be the basedir
, but you can still require files outside of it (even really "far" a away files like global modules). This is a tricky issue because whatever I end up implementing will surely make someone unhappy :(
I have not thought that, a very valid point! I.. am afraid I no concrete suggestions to solve the problem. =/ (#thinking hard)
Hi, I use Watchify (not gulp-watchify) in a gulp file and I have observed the following behavior.
The behavior remain consistent regardless of whether I add a watcher on file deleted/rename/added to call rebundle when this happens. It seems that watchify does not notice not check whether the files are still there - so maybe this is a caching issue? I suppose this is not the intended behavior.
I am using Windows 8.1, Node v0.10.35 and Watchify 2.2.1.
-- Regards