From 5515699125aab485f3bb4fc72539fa487b94296d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=87=AF90331?= <90331@sangfor.com> Date: Mon, 11 May 2026 17:46:44 +0800 Subject: [PATCH] build(scripts): add bun compile scripts for linux and windows binaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap bun build --compile to produce self-contained executables for linux-x64 (glibc/musl) and windows-x64, each in modern (AVX2) and baseline (SSE2) variants. The build:binary:* aliases run the existing build pipeline first so dist/cli.js post-processing (feature flags, import.meta.require) stays in effect. Signed-off-by: 林凯90331 <90331@sangfor.com> Co-authored-by: CoStrict --- package.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/package.json b/package.json index 9d4a1b00c..ca07aa52a 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,19 @@ "build:vite": "vite build && bun run scripts/post-build.ts", "build:vite:only": "vite build", "build:bun": "bun run build.ts", + "build:binary:linux": "bun run build && bun run compile:linux", + "build:binary:linux-baseline": "bun run build && bun run compile:linux-baseline", + "build:binary:linux-musl": "bun run build && bun run compile:linux-musl", + "build:binary:linux-musl-baseline": "bun run build && bun run compile:linux-musl-baseline", + "build:binary:win": "bun run build && bun run compile:win", + "build:binary:win-baseline": "bun run build && bun run compile:win-baseline", + "build:binary:all": "bun run build && bun run compile:linux && bun run compile:linux-baseline && bun run compile:linux-musl && bun run compile:linux-musl-baseline && bun run compile:win && bun run compile:win-baseline", + "compile:linux": "bun build dist/cli.js --compile --target=bun-linux-x64 --outfile dist/csc-linux-x64", + "compile:linux-baseline": "bun build dist/cli.js --compile --target=bun-linux-x64-baseline --outfile dist/csc-linux-x64-baseline", + "compile:linux-musl": "bun build dist/cli.js --compile --target=bun-linux-x64-musl --outfile dist/csc-linux-x64-musl", + "compile:linux-musl-baseline": "bun build dist/cli.js --compile --target=bun-linux-x64-musl-baseline --outfile dist/csc-linux-x64-musl-baseline", + "compile:win": "bun build dist/cli.js --compile --target=bun-windows-x64 --outfile dist/csc-windows-x64.exe", + "compile:win-baseline": "bun build dist/cli.js --compile --target=bun-windows-x64-baseline --outfile dist/csc-windows-x64-baseline.exe", "dev": "bun run scripts/dev.ts", "dev:inspect": "bun run scripts/dev-debug.ts", "prepublishOnly": "bun run build",