From a5c35940dab3d7ce8fc5def61b23c30415d341c5 Mon Sep 17 00:00:00 2001 From: Jonathan Pollak Date: Sun, 26 Jun 2022 08:45:31 +0300 Subject: [PATCH] fix: missing types with "moduleResolution":"Node16" Since the filename pointed at by `default` and `import` (`empty`) is not identical to the filename of the `d.ts` file (`index`), the top level `types` field is not enough when using `"moduleResolution":"Node16"` and TypeScript `4.7`. To fix this, `types` must be explicitly specified inside the `exports` object in addition to the top level `types` field. See [firebase/firebase-js-sdk#6300](/firebase/firebase-js-sdk/issues/6300) and [microsoft/playwright#14428](/microsoft/playwright/pull/14428) --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6f84c6f..9349773 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "sideEffects": false, "exports": { "default": "./empty.js", - "import": "./empty.js" + "import": "./empty.js", + "types": "./index.d.ts" }, "main": "./empty.js", "types": "./index.d.ts",