diff --git a/.changeset/react-native-exports-ordering.md b/.changeset/react-native-exports-ordering.md new file mode 100644 index 000000000..64884315b --- /dev/null +++ b/.changeset/react-native-exports-ordering.md @@ -0,0 +1,5 @@ +--- +"@knocklabs/react-native": patch +--- + +Fix the `exports` map ordering so React Native's Metro bundler resolves the package to its source entry point (`src/index.ts`) via the `react-native` condition instead of the prebuilt CommonJS bundle. The `require` condition was previously listed first, shadowing `react-native` under Metro's package-exports resolution (enabled by default since React Native 0.79). The ordering now matches the other `@knocklabs/*` packages. diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 8cfb6e53e..e963b6a6a 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -11,10 +11,11 @@ "exports": { "./package.json": "./package.json", ".": { - "require": "./dist/cjs/index.js", "types": "./dist/types/index.d.ts", "react-native": "./src/index.ts", - "default": "./dist/esm/index.mjs" + "require": "./dist/cjs/index.js", + "import": "./dist/esm/index.mjs", + "default": "./dist/cjs/index.js" } }, "files": [