-
Notifications
You must be signed in to change notification settings - Fork 33
/
vite.config.mts
39 lines (38 loc) · 921 Bytes
/
vite.config.mts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { join } from 'node:path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { VitePluginDoubleshot } from 'vite-plugin-doubleshot'
// https://vitejs.dev/config/
export default defineConfig({
root: join(__dirname, 'src/render'),
plugins: [
vue(),
VitePluginDoubleshot({
type: 'electron',
main: 'dist/main/index.js',
entry: 'src/main/index.ts',
outDir: 'dist/main',
external: ['electron'],
electron: {
build: {
config: './electron-builder.config.js',
},
preload: {
entry: 'src/preload/index.ts',
outDir: 'dist/preload',
},
},
}),
],
resolve: {
alias: {
'@render': join(__dirname, 'src/render'),
'@main': join(__dirname, 'src/main'),
},
},
base: './',
build: {
outDir: join(__dirname, 'dist/render'),
emptyOutDir: true,
},
})