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

Update TypeScript exports to support moduleResolution bundler #9

Closed
kwangure opened this issue Sep 2, 2023 · 1 comment
Closed

Comments

@kwangure
Copy link

kwangure commented Sep 2, 2023

moduleResolution: "bundler" is a recent setting added to TypeScript to support bundler setups. It's the setting you should probably be using when bundling code. With this setting TypeScript only searches for types in the exports field of the package.json.

It requires the following change:

 "exports": {
   "import": "./dist/index.js",
   "require": "./dist/index.cjs",
+  "types": "./dist/index.d.ts"
 },
@marijnh
Copy link
Collaborator

marijnh commented Sep 4, 2023

Should already work as of 426fe04

@marijnh marijnh closed this as completed Sep 4, 2023
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 a pull request may close this issue.

2 participants