Skip to content

feat(email-sdk): support CommonJS require - #169

Draft
leoisadev1 wants to merge 1 commit into
mainfrom
feat/commonjs-require
Draft

feat(email-sdk): support CommonJS require#169
leoisadev1 wants to merge 1 commit into
mainfrom
feat/commonjs-require

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

Why

CommonJS applications cannot resolve the SDK because its export map only matches ESM imports. Node.js 20.19 and newer can load this synchronous ESM graph with require(), so the package does not need a second build.

What changed

  • expose the existing ESM files to both module loaders for every public entry point
  • run the installed-package smoke test through CommonJS under Node and Bun
  • document the Node.js 20.19 minimum and add a CommonJS example
  • add a minor changeset for the new loading option

Testing

  • bun run release:ci
  • bunx oxlint scripts/check-package-tarballs.ts
  • Node.js 20.19 smoke test requiring every exported subpath

Fixes #161

Expose the existing synchronous ESM output to both module loaders so modern Node CommonJS applications can require every public entry point without a duplicate build. Test the packed package through CommonJS under Node and Bun, and document the Node 20.19 minimum for require().

Fixes #161
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
email-sdk-fumadocs Ready Ready Preview Jul 30, 2026 4:01pm

Request Review

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.

[Feature request]: Add Commonjs support

1 participant