-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathelectronBuild.ts
32 lines (31 loc) · 927 Bytes
/
electronBuild.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import * as esbuild from 'esbuild'
let result = await esbuild.build({
entryPoints: ['src/electron.ts'],
bundle: true,
outfile: 'dist/prebuild/electron.js',
external: [
"assert",
"child_process",
"constants",
"crypto",
"fs",
"http",
"https",
"net",
"os",
"path",
"readline",
"stream",
"tls",
"util",
"zlib",
"node:module",
"node:url",
"node:path",
],
banner: {
js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`
},
// inject: [`./src/cjs-shim.js`],
})
// yarn esbuild src / electron.ts--outfile = dist / prebuild / electron.js--bundle--external: path--external: http--external: fs--external: net--external: os--external: util--external: https--external: stream--external: tls--external: readline--external: child_process--external: zlib--external: assert--external: crypto--external: constants