Skip to content

Commit e12da18

Browse files
Nitivemattphillips
authored andcommitted
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
1 parent ba84464 commit e12da18

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"exports": {
88
".": {
99
"import": "./mjs/index.js",
10-
"require": "./cjs/index.js"
10+
"require": "./cjs/index.js",
11+
"types": "./index.d.ts"
1112
}
1213
},
1314
"types": "./index.d.ts",

0 commit comments

Comments
 (0)