Skip to content

feat: add native ESM builds - #21

Merged
frux merged 2 commits into
masterfrom
codex/dual-esm-builds
Sep 3, 2026
Merged

feat: add native ESM builds#21
frux merged 2 commits into
masterfrom
codex/dual-esm-builds

Conversation

@frux

@frux frux commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • publish native ESM and CommonJS entry points for both packages
  • build JavaScript, source maps, and TypeScript declarations with tsup
  • expose format-specific declarations through conditional package exports
  • mark the packages as side-effect free and publish only their dist directories
  • replace Nx task orchestration and CI commands with npm workspaces
  • preserve the Express Request.nonce type augmentation in the published declarations
  • add runtime and type-resolution tests for ESM and CommonJS consumers

Validation

  • npm run clean
  • npm test
  • npm run lint
  • npm pack --dry-run --workspace csp-header
  • npm pack --dry-run --workspace express-csp-header
  • verified tree-shaking with Rollup

Closes #14

@frux
frux merged commit 044880e into master Sep 3, 2026
1 check passed
@frux
frux deleted the codex/dual-esm-builds branch September 3, 2026 15:31
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.

csp-header package is not treeshakable.

1 participant