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

chore: support React Native's Metro bundler #22

Merged
merged 1 commit into from
Jan 28, 2022
Merged

Conversation

angeloashmore
Copy link
Member

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR adds support for use in React Native projects by adding an explicit react-native key to package.json. It points to the ES Module bundle.

Background info

React Native's bundler (Metro) does not support .cjs files. Since Metro uses the main entry in package.json, it tries to load dist/index.cjs unsuccessfully.

Metro resolves package entry files using the following order:

  • react-native
  • browser
  • main

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

⚛️

@angeloashmore angeloashmore merged commit 088e1cc into master Jan 28, 2022
@angeloashmore angeloashmore deleted the aa/react-native branch January 28, 2022 00:50
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.

None yet

1 participant