Skip to content

Commit

Permalink
Export types from package.json
Browse files Browse the repository at this point in the history
See [TypeScript #52363](microsoft/TypeScript#52363) for further information

Importing mergician without types exported results in the following error when TypeScript `moduleResolution` config is set to `Bundler`:
`Could not find a declaration file for module 'mergician'. '/node_modules/mergician/dist/mergician.esm.js' implicitly has an 'any' type.
  There are types at '/node_modules/mergician/dist/mergician.d.ts', but this result could not be resolved when respecting package.json "exports". The 'mergician' library may need to update its package.json or typings.`
  • Loading branch information
boylett authored Feb 13, 2024
1 parent 3bb3a83 commit 4b0bc0d
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 @@ -57,7 +57,8 @@
"exports": {
".": {
"import": "./dist/mergician.esm.js",
"require": "./dist/mergician.cjs"
"require": "./dist/mergician.cjs",
"types": "./dist/mergician.d.ts"
}
},
"sideEffects": false,
Expand Down

0 comments on commit 4b0bc0d

Please sign in to comment.