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 conditional exports in package #141

Merged
merged 1 commit into from
Apr 3, 2021

Conversation

haywirez
Copy link
Contributor

@haywirez haywirez commented Apr 3, 2021

This fixes an error I encountered in a dependent package (pmndrs/leva) while building it with a barebones esbuild config. According to the NodeJS docs, only "import", "require", "node" and "default" are valid keys, "module" is not:

https://nodejs.org/api/packages.html#packages_conditional_exports

(Not sure if "types" are considered by TS or not, so I left those in. Also shout-outs to @n1ru4l who correctly identified this problem 🥇 )

@peterjcaulfield
Copy link

I was literally creating a PR with this exact fix for exactly the same problem (bundling a lib that consumes leva with esbuild)! Would be great to get this patched 👍

@lgarron
Copy link
Owner

lgarron commented Apr 3, 2021

Thanks for the fix!

@lgarron lgarron merged commit eb9c0c3 into lgarron:main Apr 3, 2021
lgarron added a commit that referenced this pull request Apr 3, 2021
Release notes:

- Fix keys for module exports in `package.json`. #141
@lgarron
Copy link
Owner

lgarron commented Apr 3, 2021

Published in v3.0.3. Please let me know if that version works for you!

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.

3 participants