browserify / browser-resolve

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

Fixing resolution of deep module references without a file extension #73

Closed src-code closed 8 years ago

src-code commented 8 years ago

Addresses issue #69. Original code had a bug in it where it'd append a second .js extension if the path already had an extension, rather than appending the extension if the path didn't already have an extension.

I also went ahead and added handling for .json as well, since require.resolve() does the same.

defunctzombie commented 8 years ago

@src-code does the nodejs require function fallback to trying json files?

defunctzombie commented 8 years ago

referring to this line: https://github.com/defunctzombie/node-browser-resolve/pull/73/files#diff-168726dbe96b3ce427e7fedce31bb0bcR192

src-code commented 8 years ago

@defunctzombie Yeah, I believe so, based on this doc: https://nodejs.org/docs/latest-v0.12.x/api/modules.html#modules_all_together

defunctzombie commented 8 years ago

great!

src-code commented 8 years ago

Thank you! :+1: