Closed cymen closed 9 years ago
Absolute filepaths on your filesystem are used as the cache key so that shouldn't be a problem. In fact, I wrote browserify-incremental to use with a large app which makes use of NODE_PATH
and had no issues with it (other than the collisions you mentioned, which are predictable but do add a bit of cognitive overhead for developers).
Awesome! Thank you.
So there is a murky backwater in node such that you can set NODE_PATH in the environment to multiple directories. Say you had a file system structure like this:
Then you could do
NODE_PATH=a/b/trolls:no/trolls
and these things would work:This is stinky. But it works. Obviously, collisions are imminent. It's a bad idea all around. But... occasionally, it is useful.
Would browserify-incremental do the right thing and use the paths to the files so that if you have a collision on the require name, the actual key in the cache file does not collide? I'll figure out how to try this soon but I wanted to ask in case you already knew.