From 554e951e18daacc09ae2f74e3363fe64b72ae880 Mon Sep 17 00:00:00 2001 From: Daniel Winter Date: Fri, 12 Dec 2025 10:42:33 +0100 Subject: [PATCH] Add typesVersions for legacy TypeScript moduleResolution support Users with moduleResolution: "node" in their tsconfig couldn't import from subpaths like @hygraph/preview-sdk/react because TypeScript's legacy resolution doesn't read the exports field. Adding typesVersions provides a fallback for older setups while maintaining full compatibility with modern moduleResolution settings (bundler, node16, nodenext). --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index 2656919..f08401c 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,12 @@ "main": "./dist/index.cjs.js", "module": "./dist/index.esm.js", "types": "./dist/index.d.ts", + "typesVersions": { + "*": { + "react": ["./dist/react/index.d.ts"], + "core": ["./dist/core/index.d.ts"] + } + }, "exports": { ".": { "types": "./dist/index.d.ts",