chore(build): bump esbuild target to node25#1216
Merged
John-David Dalton (jdalton) merged 2 commits intomainfrom Apr 17, 2026
Merged
chore(build): bump esbuild target to node25#1216John-David Dalton (jdalton) merged 2 commits intomainfrom
John-David Dalton (jdalton) merged 2 commits intomainfrom
Conversation
Bill Li (billxinli)
approved these changes
Apr 17, 2026
Contributor
Author
|
Cursor (@cursor) review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit bbc0a47. Configure here.
This comment was marked as resolved.
This comment was marked as resolved.
Updates the hardcoded esbuild `target` in the two prod build configs (cli.mts and esbuild-utils.mts) from 'node18' to 'node25' so the output matches what we actually ship and run (see .node-version). No runtime behavior change; just unlocks the newer syntax lowering defaults in esbuild so the bundle doesn't carry transforms for language features that are already native in node 18+.
Introduces `createBaseConfig(inlinedEnvVars)` in esbuild-utils.mts
that returns the settings every Socket CLI esbuild config needs to
agree on:
bundle, format, minify, platform, sourcemap, target, write,
define: { 'process.env.NODE_ENV': '"production"', ...inlined }
Both callers spread it and add their variant-specific fields:
* `createIndexConfig` (index loader): banner + entry + output +
env-var replacement plugin.
* `esbuild.cli.mts` (main bundle): shebang+importMeta banner,
extra `import.meta.url` define, `keepNames`, `loader`,
`logOverride`, `metafile`, plugin stack.
Before: the Node target and six other shared settings were duplicated
between the two configs, so bumping something like `target: 'node25'`
meant remembering to touch both files (and earlier PRs did miss
exactly that pattern).
No behavior change — diffed the build output before/after.
bbc0a47 to
f9e2980
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
targetin the CLI and shared index bundlers from'node18'to'node25'to match what we actually ship and run (.node-version= 25.9.0).Why
The prior
'node18'target meant esbuild was still lowering modern syntax that's been native for years. Matching the runtime we target removes unnecessary transforms and keeps the bundle honest about the runtime floor.Test plan
pnpm run typegreenpnpm run build:clisucceedsnode25as a targetNote
Medium Risk
Build output will now assume Node 25 features; if any environments still run the generated CLI on older Node versions, bundles may fail at runtime. The change also centralizes shared esbuild options, so misconfiguration could affect both the CLI bundle and index loader builds.
Overview
Updates the Socket CLI esbuild setup to target
node25and centralizes shared bundler settings in a newcreateBaseConfig()helper.esbuild.cli.mtsandcreateIndexConfig()now spread this base config (shareddefine, CJS format, no sourcemaps/minify,write: false), reducing drift between bundles while keeping CLI-specific banner/defines/plugins on top.Reviewed by Cursor Bugbot for commit bbc0a47. Configure here.