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

Add ESM version #266

Closed
wants to merge 1 commit into from
Closed

Add ESM version #266

wants to merge 1 commit into from

Conversation

eugene1g
Copy link
Contributor

This is a minimal implementation to provide a native ESM version of the package.

The main idea is that you don't need to have both files in the repository, and can generate the ESM version just before publishing a new version. I added a minimal build script to do that without adding new dependencies. I tested the result on Node (from both CJS and ESM scripts), and on Vite + webpack (both of which consumed the generated ESM file).

In regards to TypeScript: not changes are necessary because the types are the same for CJS and ESM distribution.

Closes #253

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.

Provide esm version
1 participant