From e3cb044bf22689be5e80a48ec8ce8e7633297c1d Mon Sep 17 00:00:00 2001 From: Maxim Samoilov Date: Tue, 7 Jun 2022 17:59:57 +0400 Subject: [PATCH] Fix typings resolution when using TypeScript 4.7+ with ESM TypeScript in ESM mode is trying to use file index.d.mts for types but there is no such file. So we need to provide custom path to typings file. Root `types` field is ignored in ESM mode --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4dbe436..92b4889 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "exports": { ".": { "import": "./mjs/index.js", - "require": "./cjs/index.js" + "require": "./cjs/index.js", + "types": "./index.d.ts" } }, "types": "./index.d.ts",