-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
49 lines (45 loc) · 964 Bytes
/
build.js
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
import {build} from 'esbuild'
build({
entryPoints: ['./src/index.js'],
minify: false,
sourcemap: false,
bundle: true,
platform: "neutral",
outfile: `./dist/main.js`,
}).catch((err) => {
process.stderr.write(err.stderr);
process.exit(1);
});
build({
entryPoints: ['./src/index.js'],
minify: false,
sourcemap: 'both',
bundle: true,
platform: "neutral",
outfile: `./dist/main.mapped.js`,
}).catch((err) => {
process.stderr.write(err.stderr);
process.exit(1);
});
build({
entryPoints: ['./src/index.js'],
minify: true,
sourcemap: false,
bundle: true,
platform: "neutral",
outfile: `./dist/main.min.js`,
}).catch((err) => {
process.stderr.write(err.stderr);
process.exit(1);
});
build({
entryPoints: ['./src/index.js'],
minify: true,
sourcemap: 'both',
bundle: true,
platform: "neutral",
outfile: `./dist/main.min.mapped.js`,
}).catch((err) => {
process.stderr.write(err.stderr);
process.exit(1);
});