Skip to content

fix: use ESM format in esbuild output#223

Merged
be-next merged 1 commit intomainfrom
fix/esm-bundle
Mar 9, 2026
Merged

fix: use ESM format in esbuild output#223
be-next merged 1 commit intomainfrom
fix/esm-bundle

Conversation

@be-next
Copy link
Collaborator

@be-next be-next commented Mar 9, 2026

Summary

  • Fix format: 'cjs'format: 'esm' in esbuild.js

The package.json declares "type": "module" but esbuild was producing a CommonJS bundle (module.exports), causing a runtime error in ESM consumers:

ReferenceError: module is not defined in ES module scope

Test plan

  • npm run build produces ESM output (import statements instead of module.exports)
  • All 44 tests pass

🤖 Generated with Claude Code

The package.json declares "type": "module" but esbuild was configured
with format: 'cjs', producing a CommonJS bundle that fails at runtime
in ESM projects with "module is not defined in ES module scope".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@be-next be-next merged commit 7f01285 into main Mar 9, 2026
1 check passed
@be-next be-next deleted the fix/esm-bundle branch March 9, 2026 13:23
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