mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-16 20:24:50 +00:00
27 lines
726 B
TypeScript
27 lines
726 B
TypeScript
/**
|
|
* Cross-platform renderer build script
|
|
*/
|
|
|
|
import { spawn } from "bun";
|
|
import { existsSync, rmSync } from "fs";
|
|
import { join } from "path";
|
|
|
|
const ROOT_DIR = join(import.meta.dir, "..");
|
|
const ELECTRON_DIR = join(ROOT_DIR, "apps/electron");
|
|
|
|
// Clean renderer dist first
|
|
const rendererDir = join(ELECTRON_DIR, "dist/renderer");
|
|
if (existsSync(rendererDir)) {
|
|
rmSync(rendererDir, { recursive: true, force: true });
|
|
}
|
|
|
|
const proc = spawn({
|
|
cmd: ["bun", "run", "vite", "build", "--config", "apps/electron/vite.config.ts"],
|
|
cwd: ROOT_DIR,
|
|
stdout: "inherit",
|
|
stderr: "inherit",
|
|
env: { ...process.env, NODE_OPTIONS: "--max-old-space-size=4096" },
|
|
});
|
|
|
|
const exitCode = await proc.exited;
|
|
process.exit(exitCode);
|