问题原因: - UI 文件 (index.html) 没有被复制到 dist 目录 - Electron 主进程加载路径不正确 修复内容: - 新增 scripts/copy-ui.js: 编译后复制 UI 文件到 dist/ui/ - 修改 electron-main.ts: - 修正 UI 文件加载路径为 'ui/index.html' - 添加 sandbox: false 配置 - 添加 ready-to-show 事件监听,避免窗口闪烁 - 修改 package.json: 在构建脚本中添加 copy-ui 步骤 使用说明: - npm run build: 自动编译并复制 UI 文件 - npm run dev:electron: 开发模式运行 Electron GUI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| build-win.bat | ||
| build-win.sh | ||
| copy-ui.js | ||
| postinstall.js | ||
| prepare-build.js | ||