When importing the library in TypeScript, the type declaration isn't found.
I think this issue is caused by package.json not linking to the correct file. It's pointing to a types file in the root of the build folder, but the NPM modules doesn't come bundled with that file.
It's also worth noting that the types for ESM and CJS are identical. You can remove the types from the export fields and point to a shared types file in types. VSCode cannot read the types inside export anyway.
When importing the library in TypeScript, the type declaration isn't found. I think this issue is caused by
package.json
not linking to the correct file. It's pointing to a types file in the root of the build folder, but the NPM modules doesn't come bundled with that file.It's also worth noting that the types for ESM and CJS are identical. You can remove the types from the
export
fields and point to a shared types file intypes
. VSCode cannot read the types insideexport
anyway.