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

feat: Provide an ESM export #2760

Merged
merged 3 commits into from
Mar 25, 2024
Merged

feat: Provide an ESM export #2760

merged 3 commits into from
Mar 25, 2024

Conversation

phated
Copy link
Member

@phated phated commented Mar 25, 2024

This implements an ESM wrapper following the Node.js docs for Writing dual packages while avoiding or minimizing hazards

The test seems to work but I'm unsure if there is anything I need to do for the bin file. Perhaps someone else knows.

Closes #2634

@phated phated requested review from yocontra and sttk March 25, 2024 01:17
@perrin4869
Copy link

Since the bin field is never imported by the user, it just needs to follow the format specified by the root package.json file, no special care is needed 😃
Some people think it's good practice to also export the package.json file in the exports field

@phated phated merged commit b00de68 into master Mar 25, 2024
14 checks passed
@phated phated deleted the phated/mjs branch March 25, 2024 14:47
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.

Support named exports in mjs files
2 participants