From 8d8a5dd31ac2cb353ccdd6fd49d83357b54e1890 Mon Sep 17 00:00:00 2001 From: LeoTM <1881059+leotm@users.noreply.github.com> Date: Tue, 21 Jul 2026 15:56:07 +0100 Subject: [PATCH] feat: add package.json exports field for modern module resolution Adds an field to provide granular control over import resolution. This ensures bundlers with strict moduleResolution (e.g., TypeScript's tsgo with mode) resolve to compiled + files rather than TypeScript sources, avoiding type-check errors from deep React Native imports. --- package.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/package.json b/package.json index 59b8a5d..79da3e3 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,19 @@ "react-native": "src/index.tsx", "types": "lib/typescript/src/index.d.ts", "source": "src/index.tsx", + "exports": { + ".": { + "types": "./lib/typescript/src/index.d.ts", + "import": "./lib/module/index.js", + "require": "./lib/commonjs/index.js" + }, + "./jest/mock": { + "types": "./lib/typescript/jest/mock.d.ts", + "import": "./src/jest/mock.tsx", + "require": "./src/jest/mock.tsx" + }, + "./package.json": "./package.json" + }, "sideEffects": false, "files": [ "src",