From b7994657097b0a8c21281711a8a02a54bd721f5f Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 26 Dec 2024 12:59:50 +0100 Subject: [PATCH 1/2] build: update exports for `node16` typescript resolution resolves #324 --- package.json | 77 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 089873c..cca701e 100644 --- a/package.json +++ b/package.json @@ -22,42 +22,77 @@ "exports": { ".": { "node": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./lib/index.cjs" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "default": { - "types": "./dist/browser.d.ts", - "import": "./dist/browser.mjs", - "require": "./dist/browser.cjs" + "import": { + "types": "./dist/browser.d.mts", + "default": "./dist/browser.mjs" + }, + "require": { + "types": "./dist/browser.d.cts", + "default": "./dist/browser.cjs" + } } }, "./browser": { - "types": "./dist/browser.d.ts", - "import": "./dist/browser.mjs", - "require": "./dist/browser.cjs" + "import": { + "types": "./dist/browser.d.mts", + "default": "./dist/browser.mjs" + }, + "require": { + "types": "./dist/browser.d.cts", + "default": "./dist/browser.cjs" + } }, "./basic": { "node": { - "types": "./dist/basic.d.ts", - "import": "./dist/basic.mjs", - "require": "./dist/basic.cjs" + "import": { + "types": "./dist/basic.d.mts", + "default": "./dist/basic.mjs" + }, + "require": { + "types": "./dist/basic.d.cts", + "default": "./dist/basic.cjs" + } }, "default": { - "types": "./dist/browser.d.ts", - "import": "./dist/browser.mjs", - "require": "./dist/browser.cjs" + "import": { + "types": "./dist/browser.d.mts", + "default": "./dist/browser.mjs" + }, + "require": { + "types": "./dist/browser.d.cts", + "default": "./dist/browser.cjs" + } } }, "./core": { - "types": "./dist/core.d.ts", - "import": "./dist/core.mjs", - "require": "./dist/core.cjs" + "import": { + "types": "./dist/core.d.mts", + "default": "./dist/core.mjs" + }, + "require": { + "types": "./dist/core.d.cts", + "default": "./dist/core.cjs" + } }, "./utils": { - "types": "./dist/utils.d.ts", - "import": "./dist/utils.mjs", - "require": "./dist/utils.cjs" + "import": { + "types": "./dist/utils.d.mts", + "default": "./dist/utils.mjs" + }, + "require": { + "types": "./dist/utils.d.cts", + "default": "./dist/utils.cjs" + } } }, "main": "./lib/index.cjs", From 952b961d3eb51deb6c65b22348d138fb44b7bf79 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 27 Dec 2024 13:05:45 +0100 Subject: [PATCH 2/2] build: update export conditions --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cca701e..f314756 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ }, "require": { "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" + "default": "./lib/index.cjs" } }, "default": {