feat(deploy): M11 单二进制装配(cmd/cyrene 全链路 wire + go:embed 前端 + 外置 dist 覆盖 + 优雅关闭 + SPA 静态服务);前端 build 拷到 internal/webui/dist
This commit is contained in:
1 parent
f43eb17030
commit
a7feaeb2cb
7 files changed
+745
-1
No files matched your search
@@ -0,0 +1,15 @@
|
||||
// Copies the freshly built SPA (frontend/web/dist) into internal/webui/dist so
|
||||
// the Go package can //go:embed it into the single Cyrene binary. It runs as the
|
||||
// last step of `npm run build`. The source dist is the canonical build output,
|
||||
// so it also serves as the external deploy-override directory.
|
||||
import { cp, rm } from "node:fs/promises";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const here = dirname(fileURLToPath(import.meta.url));
|
||||
const src = resolve(here, "dist");
|
||||
const dest = resolve(here, "..", "..", "internal", "webui", "dist");
|
||||
|
||||
await rm(dest, { recursive: true, force: true });
|
||||
await cp(src, dest, { recursive: true });
|
||||
console.log(`webui: copied ${src} -> ${dest}`);
|
||||
@@ -6,7 +6,7 @@
|
||||
"description": "Cyrene v2 user frontend (M9 modal UI) — Miuix design language",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc --noEmit && vite build",
|
||||
"build": "tsc --noEmit && vite build && node copy-dist.mjs",
|
||||
"preview": "vite preview",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user