mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
feat(electron): 引入 Electron 桌面应用支持
- 添加 Electron 主进程入口文件 main.ts - 配置 Vite 插件以支持 Electron 构建 - 更新 package.json 添加 Electron 相关依赖和构建脚本 - 修改路由历史模式为 HashHistory 以兼容 Electron 环境 - 调整构建流程分离服务端与客户端打包任务 - 新增 Electron 应用图标和基础窗口配置 - 集成开发服务器 URL 加载逻辑与静态文件加载 fallback - 更新构建日期并设置主进程入口点字段 - 添加 Windows 安装包构建目标及输出目录配置 - 优化依赖预构建列表以提升启动性能 - 分离 release 资源收集路径并增强跨平台兼容性 - 升级部分工具链版本以获得最新功能支持
This commit is contained in:
@@ -2,6 +2,7 @@ import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import path from 'node:path'
|
||||
import electron from 'vite-plugin-electron/simple'
|
||||
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
@@ -44,7 +45,18 @@ export default defineConfig({
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [vue(), tailwindcss()],
|
||||
plugins: [
|
||||
vue(),
|
||||
tailwindcss(),
|
||||
electron({
|
||||
main: {
|
||||
// Shortcut of `build.lib.entry`
|
||||
entry: 'electron/main.ts',
|
||||
},
|
||||
// Optional: Use Node.js API in the Renderer process
|
||||
renderer: {},
|
||||
}),
|
||||
],
|
||||
resolve: { alias: { '@': path.resolve(__dirname, './src') } },
|
||||
// 优化依赖预构建
|
||||
optimizeDeps: { include: ['vue', 'vue-router', 'pinia', 'reka-ui', '@vueuse/core', 'lucide-vue-next', 'crypto-js', 'file-saver'] }
|
||||
|
||||
Reference in New Issue
Block a user