Skip to content

feat: add proper ESM support for modern bundlers #71

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pumpkinzomb
Copy link

Overview

This PR improves the fonteditor-core library to work seamlessly with modern ESM-compatible environments such as Vite, Next.js, Webpack 5, and others. The current codebase mixes CommonJS and ESM syntax, causing import errors when used in ESM environments.

Changes

  • Implemented dual package exports pattern in package.json (supporting both CommonJS and ESM)
  • Added an ESM-specific entry point file (main.mjs)
  • Modified build script to include ESM module files in the build output
  • Improved TypeScript declaration file path references
  • Added documentation for ESM usage with a markdown guide

Testing

  • All existing tests pass
  • Verified working correctly in ESM environments (Vite, Next.js)

With these changes, users can import fonteditor-core directly as an ESM module in modern bundlers without additional configuration.

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.

1 participant