File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import { build } from 'esbuild'
88import { execSync } from 'node:child_process'
99import { randomUUID } from 'node:crypto'
1010import { existsSync , readFileSync } from 'node:fs'
11- import { builtinModules } from 'node:module'
1211import path from 'node:path'
1312import { fileURLToPath } from 'node:url'
1413
@@ -102,12 +101,16 @@ const config = {
102101 entryPoints : [ path . join ( rootPath , 'src/cli-dispatch.mts' ) ] ,
103102 bundle : true ,
104103 outfile : path . join ( rootPath , 'dist/cli.js' ) ,
104+ // Target Node.js environment (not browser).
105105 platform : 'node' ,
106- target : 'node20' ,
106+ // Target Node.js 18+ features.
107+ target : 'node18' ,
107108 format : 'cjs' ,
108109
109- // Externalize Node.js built-ins.
110- external : [ ...builtinModules , ...builtinModules . map ( m => `node:${ m } ` ) ] ,
110+ // With platform: 'node', esbuild automatically externalizes all Node.js
111+ // built-ins. The explicit external array with builtinModules is redundant
112+ // (but doesn't hurt as extra safety).
113+ external : [ ] ,
111114
112115 // Add shebang.
113116 banner : {
You can’t perform that action at this time.
0 commit comments