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 ESM output #4

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Fix ESM output #4

merged 1 commit into from
Dec 9, 2024

Conversation

buzinas
Copy link
Contributor

@buzinas buzinas commented Aug 18, 2024

During my Vite investigation, I realized that this package's ESM output wasn't working correctly.

Although we were renaming index.js to index.mjs on the build:esm script, the imports weren't working for two reasons:

  • All files should have a .mjs extension, otherwise the file is considered a CommonJS module.
  • Even if I renamed all files to .mjs, it wasn't working, because the imports inside the files need to use the extension.

In order to ease the process, I just added tsup which supports outputting both formats.

I already published the package as v0.2.2 so I just need a review in order to merge this.

@buzinas buzinas requested a review from treycucco August 18, 2024 02:01
Copy link
Collaborator

@treycucco treycucco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making these changes Vitor! I pulled in the branch locally and ran the build and everything looks as expected.

@buzinas buzinas merged commit f63e0dd into main Dec 9, 2024
3 checks passed
@buzinas buzinas deleted the fix-esm branch December 9, 2024 19:10
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