-
Notifications
You must be signed in to change notification settings - Fork 1
/
bundle.mjs
50 lines (47 loc) · 926 Bytes
/
bundle.mjs
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import esbuild from "esbuild";
esbuild.build({
logLevel: 'info',
entryPoints: [
'egyptianNumber.ts',
'seshat.ts',
],
bundle: true,
minify: true,
platform: 'node',
sourcemap: 'external',
outdir: 'build/lib/',
define: {
'process.env.NODE_DEBUG': 'false',
},
})
.catch((reason) => process.exit(1))
;
const options = {
logLevel: 'info',
entryPoints: [
'seshatStandardLibrary.ts',
'seshatToJavascript.ts',
],
bundle: true,
minify: true,
platform: 'neutral',
sourcemap: 'external',
outdir: 'build/lib/',
mainFields: ['module', 'main'],
define: {
'process.env.NODE_DEBUG': 'false',
},
};
if (process.argv.length > 2 && process.argv[2] == '--serve') {
(await esbuild.context(options))
.serve({
servedir: 'build/',
})
.catch((reason) => process.exit(1))
;
}
else {
esbuild.build(options)
.catch((reason) => process.exit(1))
;
}