-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathelectron.vite.config.ts
More file actions
44 lines (43 loc) · 1.1 KB
/
Copy pathelectron.vite.config.ts
File metadata and controls
44 lines (43 loc) · 1.1 KB
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
40
41
42
43
44
import { resolve } from 'node:path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import react from '@vitejs/plugin-react'
// electron-vite splits the build into three independent bundles: main (Node),
// preload (sandboxed CJS) and renderer (Chromium). Native/runtime deps stay
// external in main/preload via externalizeDepsPlugin so they load from
// node_modules at runtime instead of being inlined.
export default defineConfig({
main: {
resolve: {
alias: {
'@shared': resolve('src/shared')
}
},
plugins: [externalizeDepsPlugin()]
},
preload: {
resolve: {
alias: {
'@shared': resolve('src/shared')
}
},
plugins: [externalizeDepsPlugin()]
},
renderer: {
root: 'src/renderer',
resolve: {
alias: {
'@renderer': resolve('src/renderer/src'),
'@shared': resolve('src/shared')
}
},
plugins: [react()],
build: {
rollupOptions: {
input: {
index: resolve('src/renderer/index.html'),
splash: resolve('src/renderer/splash.html')
}
}
}
}
})