browserify / browser-resolve

resolve function which support the browser field in package.json
MIT License
102 stars 70 forks source link

Breakage when a browser shim file does not exist #46

Closed atrigent closed 9 years ago

atrigent commented 10 years ago

Near as I can tell, part of the contract of the "resolve" operation is that it will always return a path to an extant file, provided that it does not throw an exception. This module breaks that contract. It does not check anywhere whether the files specified in the "browser" field actually exist, so it can potentially return paths to nonexistent files.

I'm having some trouble expressing the specific problem here, so I'm going to explain it by writing some failing tests in the near future.

defunctzombie commented 9 years ago

I understand what you are saying here. So you think that this module should check that the files referenced in the field exist? What about if you reference a module versus a file?