feat:项目打包成Electron
This commit is contained in:
30
desktop/electron.vite.config.ts
Normal file
30
desktop/electron.vite.config.ts
Normal 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)
|
||||
})
|
||||
Reference in New Issue
Block a user