first commit

This commit is contained in:
2026-10-11 12:56:38 +08:00
commit 7d21f317a4
41 changed files with 10758 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
// 前端「构建」:本项目无框架、无打包步骤,纯静态文件直接拷贝。
//
// 之所以还留这个脚本:Wails 的 embed 指向 frontend/dist,
// 需要一个入口把源码同步进去。顺带避免手工拷贝漏文件。
const fs = require('fs');
const path = require('path');
const FRONTEND = __dirname;
const DIST = path.join(FRONTEND, 'dist');
// 需要原样拷贝的入口文件与目录(wailsjs 不用拷 —— 那是 wails build 自动生成的绑定)
const ENTRIES = ['index.html', 'css', 'js'];
function copy() {
fs.mkdirSync(DIST, { recursive: true });
for (const name of ENTRIES) {
const src = path.join(FRONTEND, name);
if (!fs.existsSync(src)) continue;
fs.rmSync(path.join(DIST, name), { recursive: true, force: true });
fs.cpSync(src, path.join(DIST, name), { recursive: true });
}
console.log('[frontend] 资源已同步到 dist/');
}
copy();