Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better extension lookup #18

Open
jonathanong opened this issue Feb 8, 2014 · 1 comment
Open

better extension lookup #18

jonathanong opened this issue Feb 8, 2014 · 1 comment
Labels

Comments

@jonathanong
Copy link
Contributor

should go through all the fields in the order defined and look for:

  • exact match file.path === path
  • extensionless match file.path.replace(/\.\w+$/, '') === path
  • folder-index match file.path.replace(/\/index\.\w+$/, '') === path

making it extension-agnostic unlike node's ['', '.js', '.json', '/index.js'] lookup, which this builder currently does

@timaschew
Copy link
Member

if you have this directory structure:

foo.js
foo/
  index.js

require("./foo") would match the file and not the directory is that desired?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants