From 977c5e6a33b663732e8716b9dbeb7e42de6ed675 Mon Sep 17 00:00:00 2001 From: Simon Shiki <59327348+SimonShiki@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:00:14 +0800 Subject: [PATCH] chore: fix type error in typescript 4.7 above (#5) https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#packagejson-exports-imports-and-self-referencing Signed-off-by: SimonShiki --- package.json | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 75735fa..f35ab11 100644 --- a/package.json +++ b/package.json @@ -28,13 +28,28 @@ "exports": { ".": { "solid": "./dist/source/index.js", - "import": "./dist/esm/index.js", + "import": { + "types": "./dist/types/index.d.ts", + "default": "./dist/esm/index.js" + }, "browser": { - "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.cjs" + "import": { + "types": "./dist/types/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/types/index.d.ts", + "default": "./dist/cjs/index.cjs" + } + }, + "require": { + "default": "./dist/cjs/index.cjs", + "types": "./dist/types/index.d.ts" }, - "require": "./dist/cjs/index.cjs", - "node": "./dist/cjs/index.cjs" + "node": { + "default": "./dist/cjs/index.cjs", + "types": "./dist/types/index.d.ts" + } } }, "scripts": {