Skip to content

Commit

Permalink
fix: include types in export
Browse files Browse the repository at this point in the history
When a package is being loaded via native ESM with TypeScript in
`node16` mode, it looks up the types from the `export` property in
package.json
Defining a `types` property in `exports` allows for lookup of the
typings

see: https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing
  • Loading branch information
ChristianMurphy committed Jan 16, 2023
1 parent 2a29fa8 commit 3026691
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"types": "index.d.ts",
"module": "index.mjs",
"exports": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./index.js"
},
Expand Down

0 comments on commit 3026691

Please sign in to comment.