-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ts
56 lines (49 loc) · 1.15 KB
/
build.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* eslint-disable no-console */
import dts from "bun-plugin-dts";
import * as fs from "fs";
fs.rmSync("./dist", { recursive: true });
let result = await Bun.build({
entrypoints: ["src/index.ts"],
outdir: "./dist",
target: "browser",
plugins: [dts()],
minify: true,
sourcemap: "external",
});
if (!result.success) {
console.error("Build failed");
for (const message of result.logs) {
// Bun will pretty print the message object
console.error(message);
}
}
result = await Bun.build({
entrypoints: ["src/grpc/browser.ts"],
outdir: "./dist",
target: "browser",
plugins: [dts()],
minify: true,
sourcemap: "external",
});
if (!result.success) {
console.error("Build failed");
for (const message of result.logs) {
// Bun will pretty print the message object
console.error(message);
}
}
result = await Bun.build({
entrypoints: ["src/grpc/node.ts"],
outdir: "./dist",
target: "node",
plugins: [dts()],
minify: true,
sourcemap: "external",
});
if (!result.success) {
console.error("Build failed");
for (const message of result.logs) {
// Bun will pretty print the message object
console.error(message);
}
}