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

Fix TypeScript usage with node16 #25

Merged
merged 3 commits into from
Nov 30, 2022
Merged

Fix TypeScript usage with node16 #25

merged 3 commits into from
Nov 30, 2022

Conversation

leonsilicon
Copy link
Contributor

Currently, when using use-force-update with ESM and Node16 "moduleResolution" in TypeScript, TypeScript is unable to resolve the types because it checks for a type definition file at ./dist/esm/index.d.ts, which doesn't exist.

I fixed this by adding an explicit "types" property that points to ./dist/types/index.d.ts inside the "exports" property, based on the screenshot of the docs below (screenshot from https://www.typescriptlang.org/docs/handbook/esm-node.html):

image

@quisido
Copy link
Owner

quisido commented Nov 30, 2022

Thank you for this! 🤗

I went ahead and patched the version number here so that it will CI/CD. It should be available via NPM any minute now.

I also upgraded Yarn to 3.3 since Node LTS apparently isn't compatible with Yarn 3.2.

@quisido quisido merged commit 258c726 into quisido:main Nov 30, 2022
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.

2 participants