From 4a9765785c1d568e980c40a7a431e220925e8ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Fri, 3 Feb 2023 16:37:24 +0100 Subject: [PATCH 1/2] Add the `types` condition to the `package.json#exports` --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index afbc41c..5f6d8f7 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "types": "./dist/index.d.ts", "exports": { ".": { + "types": "./dist/index.d.ts", "import": "./dist/index.mjs", "require": "./dist/index.js" } From 1a08a8aee63da27e6a7c1afd9354a95f20a6201e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Mon, 6 Feb 2023 21:57:14 +0100 Subject: [PATCH 2/2] Add `index.d.mts` --- index.d.mts | 4 ++++ package.json | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 index.d.mts diff --git a/index.d.mts b/index.d.mts new file mode 100644 index 0000000..692b785 --- /dev/null +++ b/index.d.mts @@ -0,0 +1,4 @@ +import ns from './dist/index.js' + +export * from './dist/index.js' +export default ns.default diff --git a/package.json b/package.json index 5f6d8f7..5eec294 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,19 @@ "types": "./dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.js" + "import": { + "types": "./index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } } }, "files": [ - "dist" + "dist", + "index.d.mts" ], "scripts": { "dev": "npm run build -- --watch ./src",