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

allow for optional relative resolve for non-standard extensions #428

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sterlingwes
Copy link

@sterlingwes sterlingwes commented Aug 29, 2021

This looks to resolve #201 which is a continuation of a couple open PRs: #259 and #317.

The feedback I see in those PRs seems to be that this is for a "non-standard" use case and the effect of putting relative path resolution in the "standard path" could be detrimental to the vast majority of use cases.

For this PR I've opted to make the relative resolution strategy an opt-in. Therefore, if you were looking to replicate the react-native extension behaviour, you'd have the following config:

{
  resolveRelativePaths: true,
  extensions: ['.ios.js', '.android.js', '.js'],
  stripExtensions: [],
}

or some variation. I'd note that this behaviour is becoming standard with the .web.js and .native.js extensions that are proliferating in react-land. I needed this for react-redux for example, which uses this to select the right batch method.

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

Successfully merging this pull request may close these issues.

Module extensions not working?
1 participant