Skip to content

Conversation

@pumpkinzomb
Copy link
Contributor

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.

@kekee000 kekee000 merged commit b971401 into kekee000:master Jul 9, 2025
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