Skip to content

Commit

Permalink
Export types in package.json (#544)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Co-authored-by: rodrigo <[email protected]>
  • Loading branch information
stephenglass and falsepopsky authored Apr 19, 2023
1 parent 2b2d422 commit 0219090
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

1 comment on commit 0219090

@vercel
Copy link

@vercel vercel bot commented on 0219090 Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.