prismicio / prismic-types

Type definitions for Prismic content, models, and APIs
https://prismic.io/docs/technologies/javascript
Apache License 2.0
11 stars 4 forks source link

chore: support React Native's Metro bundler #22

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:

⚛️