-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ts
20 lines (18 loc) · 892 Bytes
/
build.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { build, $ } from "bun";
const packageInfo = await Bun.file("./package.json").json();
build({
entrypoints: ["./src/main.ts"],
outdir: "output",
target: "bun",
minify: true,
define: {
"Bun.env.PROGRAM_NAME": packageInfo.name,
"Bun.env.PROGRAM_VERSION": `v${packageInfo.version}`,
"Bun.env.PROGRAM_DESCRIPTION": packageInfo.description,
},
}).then(async () => {
await $`bun build output/main.js --compile --target=bun-darwin-arm64 --minify --outfile dist/notion-qq-robot-cli_v${packageInfo.version}_mac-arm64`;
await $`bun build output/main.js --compile --target=bun-windows-x64-modern --minify --outfile dist/notion-qq-robot-cli_v${packageInfo.version}_windows-x64-modern.exe`;
await $`bun build output/main.js --compile --target=bun-linux-x64 --minify --outfile dist/notion-qq-robot-cli_v${packageInfo.version}_linux-x64`;
await $`rm -rf output`;
});