Skip to content

Switch build tooling from ncc to esbuild#676

Merged
jeffwidman merged 1 commit intomainfrom
switch-build-to-esbuild
Mar 26, 2026
Merged

Switch build tooling from ncc to esbuild#676
jeffwidman merged 1 commit intomainfrom
switch-build-to-esbuild

Conversation

@truggeri
Copy link
Copy Markdown
Contributor

@truggeri truggeri commented Mar 26, 2026

Summary

Part 1 of a larger update, see #673 .

Replace @vercel/ncc and ts-node with esbuild for bundling. This prepares the project for ESM-only dependencies (@actions/core 3.x and @actions/github 9.x use ESM-only exports that ncc cannot resolve).

Changes

  • Build script: ncc buildesbuild --bundle --platform=node --format=cjs
  • Dry-run script: ts-node → esbuild bundle + node
  • Jest config: Added ESM transform (.js files), transformIgnorePatterns to allow transforming @actions/* and @octokit/* packages, and a custom resolver (jest-resolver.js) that adds the import condition for @actions/* packages
  • tsconfig.json: Added skipLibCheck: true for library subpath exports compatibility
  • Removed: @vercel/ncc, ts-node dev dependencies
  • Added: esbuild dev dependency

Note: This is PR 1 of 3. Merge before [PR 2: Upgrade @actions/core] and [PR 3: Upgrade @actions/github].

Replace @vercel/ncc and ts-node with esbuild for bundling. This
prepares the project for ESM-only dependencies (@actions/core 3.x
and @actions/github 9.x use ESM-only exports).

Changes:
- Build script: ncc build → esbuild --bundle --platform=node --format=cjs
- Dry-run script: ts-node → esbuild bundle + node
- Jest: add ESM transform, transformIgnorePatterns, custom resolver
- tsconfig: add skipLibCheck for library subpath exports compatibility
- Remove @vercel/ncc and ts-node dev dependencies
Copy link
Copy Markdown
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't understand a lot of these flags/configs, but I walked through it with copilot and they make sense to me

Comment thread .gitignore
.idea/
.vscode/ No newline at end of file
.vscode/
dist/dry-run.js No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

@jeffwidman jeffwidman merged commit c1d3c93 into main Mar 26, 2026
9 checks passed
@jeffwidman jeffwidman deleted the switch-build-to-esbuild branch March 26, 2026 04:55
Comment thread tsconfig.json
"noImplicitAny": false,
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can drop this with a few other changes:

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.

2 participants