feat: 新增docs静态资源与Electron主进程

添加了docs目录及其静态资源文件,支持前端文档和演示页面部署。新增dist-electron/main.js,实现Electron主进程窗口加载本地docs或开发服务器。更新.gitignore,允许docs目录纳入版本控制。
This commit is contained in:
谦君
2025-12-14 15:59:32 +08:00
parent 00d7f15380
commit 44580909a3
44 changed files with 164 additions and 4 deletions

12
dist-electron/main.js Normal file
View File

@@ -0,0 +1,12 @@
import { BrowserWindow, app } from "electron";
import path, { dirname } from "node:path";
import { fileURLToPath } from "node:url";
app.whenReady().then(() => {
let i = dirname(fileURLToPath(import.meta.url)), a = new BrowserWindow({
title: "OGame",
icon: path.join(i, "../public/favicon.ico"),
width: 1200,
height: 800
});
a.setMenu(null), process.env.VITE_DEV_SERVER_URL ? a.loadURL(process.env.VITE_DEV_SERVER_URL) : a.loadFile("docs/index.html");
});