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

Node's require.resolve options #150

Closed
reggi opened this issue Feb 18, 2018 · 2 comments
Closed

Node's require.resolve options #150

reggi opened this issue Feb 18, 2018 · 2 comments

Comments

@reggi
Copy link

reggi commented Feb 18, 2018

I see there's a lot of discussion about what the defaults should be for this module. It seems like it's too late for that. This module is already in use. However I'm using this in a project and expected .json to work as well as package.json main, and it's not. I would appreciate if someone could share what options that should be passed to mimic the node's default, perhaps we can add another function to this module in the future or just add it to the docs to help mitigate confusion.

How do I get it to check for package.json main?

Starting the config here:

{
  "extensions": [ ".js", ".json", ".node"]
}
@ljharb
Copy link
Member

ljharb commented Feb 18, 2018

That indeed should do it, since those are the default extensions; you can also do "extensions": require.extentions

@reggi
Copy link
Author

reggi commented Feb 22, 2018

Ah, ok the issue i'm having is related to Promises.

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

No branches or pull requests

2 participants