Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "types" to package.json exports spec #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jgoz
Copy link

@jgoz jgoz commented Mar 8, 2024

Fixes #191
Closes #188
Closes #192

Enables compatibility with various TypeScript module resolution modes: https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports

Technically, you can avoid specifying "types" in an "exports" spec because TypeScript will attempt file extension substitution. However, in resolution modes that prefer the "import" condition, it will attempt to substitute the extension using the basename tinykeys.module and will not find anything.

The easiest fix is to specify "types" and avoid the substitution path.

Enables compatibility with TypeScript's "bundler" module resolution mode.
@JustPilz
Copy link

JustPilz commented May 2, 2024

@jamiebuilds
please merge this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript types not resolving when using tsconfig with moduleResolution: "Bundler"
2 participants