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

Metro+TS: support additional package.json fields when resolving a module to a file #805

Closed
5 tasks done
afoxman opened this issue Nov 3, 2021 · 1 comment
Closed
5 tasks done
Labels
bug Something isn't working

Comments

@afoxman
Copy link
Contributor

afoxman commented Nov 3, 2021

What happened?

In @rnx-kit/typescript-react-native-resolver, the function resolveModule (src/resolve.ts) looks for "default" entry point files in package.json -- fields like "main", "types", and "typings".

Repos using newer or custom tech may have other custom fields in their package.json files which refer to additional entry points. For example, Apollo uses the "module" field to refer to the main ES6 module in the package.

This should be an optional configuration parameter which defaults to no additional fields.

Affected Package

@rnx-kit/typescript-react-native-resolver

Version

Which platforms are you seeing this issue on?

  • Android
  • iOS
  • macOS
  • Windows

System Information

N/A

Steps to Reproduce

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct
@afoxman
Copy link
Contributor Author

afoxman commented Mar 20, 2022

TypeScript doesn't support this type of extension, though they do have a more sophisticated resolver. With microsoft/TypeScript#48189 being imminently accepted into TS main, I will be deprecating typescript-react-native-resolver.

@afoxman afoxman closed this as completed Mar 20, 2022
@afoxman afoxman added this to rnx-kit Mar 20, 2022
@afoxman afoxman removed this from rnx-kit Mar 20, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant