From 3026691e090a6763f3b03d13a9251952d15b2e7a Mon Sep 17 00:00:00 2001 From: Christian Murphy Date: Mon, 16 Jan 2023 13:10:05 -0700 Subject: [PATCH] fix: include types in export 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 --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index d2b34d5..496d35d 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "types": "index.d.ts", "module": "index.mjs", "exports": { + "types": "./index.d.ts", "import": "./index.mjs", "require": "./index.js" },