-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ts
More file actions
44 lines (41 loc) · 972 Bytes
/
build.ts
File metadata and controls
44 lines (41 loc) · 972 Bytes
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
import { build } from "bun";
import { dts } from "bun-dts";
import { rm } from "node:fs/promises";
const outdir = "dist";
console.time("remove outdir");
await rm(outdir, { recursive: true, force: true });
console.timeEnd("remove outdir");
console.time("build");
await Promise.all([
build({
entrypoints: ["bun.ts", "esb.ts", "runtime.ts"],
external: ["esbuild"],
target: "node",
minify: false,
sourcemap: "linked",
outdir,
plugins: [dts()],
}),
build({
entrypoints: [
"files/node/handler.ts",
"files/node/stream.ts",
"files/bun/handler.ts",
],
external: ["SERVER", "MANIFEST"],
target: "node",
minify: false,
sourcemap: "none",
outdir: `${outdir}/files`,
}),
build({
entrypoints: ["cdk.ts"],
external: ["aws-cdk", "aws-cdk-lib", "constructs"],
target: "node",
minify: false,
sourcemap: "linked",
outdir,
plugins: [dts()],
}),
]);
console.timeEnd("build");