Skip to content

feat: add ESM support while maintaining CommonJS compatibility#171

Open
matthew-muscat wants to merge 2 commits into
braintree:mainfrom
matthew-muscat:add-esm-support
Open

feat: add ESM support while maintaining CommonJS compatibility#171
matthew-muscat wants to merge 2 commits into
braintree:mainfrom
matthew-muscat:add-esm-support

Conversation

@matthew-muscat

Copy link
Copy Markdown
  • Add dual CJS/ESM builds with separate TypeScript configs
  • Update package.json exports map and module field
  • Add .js extensions to imports for ESM compatibility
  • Restructure tests into test/unit and test/integration folders
  • Add integration tests for both module formats
  • Support tree-shaking with named exports alongside default export

No breaking changes - existing CommonJS usage continues to work exactly as before. ESM users can now use modern import syntax and benefit from tree-shaking.

- Add dual CJS/ESM builds with separate TypeScript configs
- Update package.json exports map and module field
- Add .js extensions to imports for ESM compatibility
- Restructure tests into test/unit and test/integration folders
- Add integration tests for both module formats
- Support tree-shaking with named exports alongside default export

No breaking changes - existing CommonJS usage continues to work exactly as before.
ESM users can now use modern import syntax and benefit from tree-shaking.

Signed-off-by: Matthew Muscat <matthew@mamis.com.au>
@matthew-muscat matthew-muscat requested a review from a team as a code owner July 10, 2025 02:24
Signed-off-by: Matthew Muscat <matthew@mamis.com.au>
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