preactjs / preact-router

:earth_americas: URL router for Preact.
http://npm.im/preact-router
MIT License
1.01k stars 156 forks source link

Add types to package.json exports mapping #444

Closed jhirvioja closed 1 year ago

jhirvioja commented 1 year ago

Currently, preact-router errors when in TypeScripts config the moduleResolution is "bundler", "Node16" or "NodeNext". See example of error message here: https://github.com/preactjs/preact-router/issues/443

One proposed fix is to include types in the package.json's exports mapping. See example here: https://github.com/preactjs/preact-router/issues/429

This proposed fix is implemented in this pull request. If this is not a reasonable fix, some other fix should be introduced.

Related: https://github.com/microsoft/TypeScript/issues/52363

rschristian commented 1 year ago

Thanks!