feat:项目打包成Electron

This commit is contained in:
2026-06-14 18:10:58 +08:00
parent 7a0443ebcc
commit 8970b63800
20 changed files with 3895 additions and 11 deletions

View File

@@ -0,0 +1,30 @@
import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
build: {
outDir: 'dist/main',
rollupOptions: {
input: {
index: resolve(__dirname, 'main/index.ts'),
},
},
},
},
preload: {
plugins: [externalizeDepsPlugin()],
build: {
outDir: 'dist/preload',
rollupOptions: {
input: {
index: resolve(__dirname, 'preload/index.ts'),
},
},
},
},
// 前端是独立项目,不使用 electron-vite 的 renderer 配置
// 开发时连接外部 Vite dev server (http://localhost:5173)
// 生产时加载本地文件 (../frontend/dist/index.html)
})