31 lines
777 B
TypeScript
31 lines
777 B
TypeScript
|
|
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)
|
||
|
|
})
|