Skip to content

Conversation

@UmbraCi
Copy link
Contributor

@UmbraCi UmbraCi commented Oct 22, 2025

Summary

This PR adds support for multiple build output formats to better serve different use cases.

Changes

  • Configure Rollup to generate three output formats:
    • ES Module () - for modern bundlers with tree-shaking support
    • CommonJS () - for require/legacy toolchains
    • UMD () - for direct usage with global variables
  • Update package.json:
    • Set main to CommonJS entry
    • Set module to ES Module entry
    • Add unpkg fields for CDN usage
    • Update exports field to support conditional imports
    • Add all output directories to files field
  • Update .gitignore to exclude build outputs

Benefits

  • Modern bundlers can use ES modules for better tree-shaking
  • Legacy tools can continue using CommonJS
  • CDN users can directly include UMD builds via <script> tags
  • Better compatibility across different environments

Testing

  • ✅ Build succeeds and generates all three formats
  • ✅ All formats include source maps
  • ✅ Main library and plugins are built in all formats

- Configure Rollup to generate three output formats:
  - ES Module (es/) for modern bundlers with tree-shaking
  - CommonJS (lib/) for require/legacy toolchains
  - UMD (dist/) for direct script usage with global variables
- Update package.json exports to support all formats
- Add build outputs to .gitignore
- Support both unpkg and jsdelivr CDN usage
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