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!: use .mjs for esm output #197

Merged
merged 2 commits into from
Mar 3, 2022
Merged

feat!: use .mjs for esm output #197

merged 2 commits into from
Mar 3, 2022

Conversation

bluwy
Copy link
Contributor

@bluwy bluwy commented Feb 8, 2022

When using this in node, the CJS output is being loaded even though the library exports ESM output. I've adjusted the ESM output to end with the .mjs extension, and added an exports field so that node resolves to it.

@antfu
Copy link
Collaborator

antfu commented Mar 2, 2022

This would be a breaking change. Giving magic-string currently support down to Node v10, we might need to introduce a breaking change to deprecate v10 to support this.

@bluwy
Copy link
Contributor Author

bluwy commented Mar 3, 2022

Good point. To be safe, I agree this should be a minor bump for 0.x. Though I think normal Node 10 resolution algorithm should avoid the .mjs paths, since Node 10 doesn't read pkg.module and pkg.exports, so we could get away bumping the node version perhaps 🤔

@antfu antfu changed the title use mjs for esm output feat!: use .mjs for esm output Mar 3, 2022
@antfu antfu merged commit 62d6e85 into Rich-Harris:master Mar 3, 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