From 02190909c7c8ed9a72a37402a710d27dadcf2965 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Wed, 19 Apr 2023 02:00:51 -0400 Subject: [PATCH] Export types in package.json (#544) * Export types in package.json Types are not exported in package.json file. When using new "bundler" option for moduleResolution field included in TypeScript V5, you will receive the following error: error TS7016: Could not find a declaration file for module 'goober'. '.../node_modules/goober/dist/goober.modern.js' implicitly has an 'any' type. There are types at '.../node_modules/goober/goober.d.ts', but this result could not be resolved when respecting package.json "exports". The 'goober' library may need to update its package.json or typings. * Update package.json Co-authored-by: rodrigo --------- Co-authored-by: rodrigo --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f0c6c9ff..dcc18a65 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ ".": { "require": "./dist/goober.cjs", "import": "./dist/goober.modern.js", - "umd": "./dist/goober.umd.js" + "umd": "./dist/goober.umd.js", + "types": "./goober.d.ts" }, "./macro": "./macro/index.js", "./global": {