Skip to content

Commit

Permalink
Fix typings resolution when using TypeScript 4.7+ with ESM
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Nitive authored and mattphillips committed Nov 12, 2022
1 parent ba84464 commit e12da18
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -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",
Expand Down

0 comments on commit e12da18

Please sign in to comment.