Commit 691cc07
authored
chore(build): bump esbuild target to node25 (#1216)
* chore(build): bump esbuild target to node25
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+.
* chore(build): extract shared esbuild base config (DRY)
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.1 parent 1e443ae commit 691cc07
File tree
2 files changed
+53
-45
lines changed- packages/cli
- .config
- scripts
2 files changed
+53
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
62 | 72 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 80 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 81 | + | |
88 | 82 | | |
89 | 83 | | |
90 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
18 | 47 | | |
19 | 48 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 49 | | |
25 | | - | |
26 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
27 | 57 | | |
28 | 58 | | |
29 | | - | |
| 59 | + | |
| 60 | + | |
30 | 61 | | |
31 | 62 | | |
32 | 63 | | |
33 | | - | |
34 | 64 | | |
35 | | - | |
36 | | - | |
37 | 65 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 66 | | |
49 | | - | |
50 | | - | |
51 | 67 | | |
52 | | - | |
53 | | - | |
54 | 68 | | |
55 | 69 | | |
56 | 70 | | |
| |||
0 commit comments