prismicio / prismic-react

React components and hooks to fetch and present Prismic content
https://prismic.io/docs/technologies/homepage-reactjs
Apache License 2.0
154 stars 40 forks source link

chore: support React Native's Metro bundler #119

Closed angeloashmore closed 2 years ago

angeloashmore commented 2 years ago

Types of changes

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:

Checklist:

⚛️

github-actions[bot] commented 2 years ago

size-limit report 📦

Path Size
dist/index.mjs 4.08 KB (0%)
dist/index.cjs 5.63 KB (0%)