-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathelectron.vite.config.ts
44 lines (42 loc) · 1.04 KB
/
electron.vite.config.ts
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 yaml from '@modyfi/vite-plugin-yaml'
import react from '@vitejs/plugin-react'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import path from 'path'
// TODO: Rebase on useTsconfigPath plugin
const alias = {
'@client': path.resolve(__dirname, 'client'),
'@desktop': path.resolve(__dirname, 'desktop'),
'@locale': path.resolve(__dirname, 'locale'),
}
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
resolve: { alias },
build: {
lib: { entry: 'desktop/index.ts' },
outDir: 'build/desktop',
},
},
preload: {
plugins: [externalizeDepsPlugin()],
resolve: { alias },
build: {
lib: { entry: 'desktop/preload/index.ts' },
outDir: 'build/desktop/preload',
},
},
renderer: {
root: 'client',
plugins: [react(), yaml()],
resolve: { alias },
build: {
outDir: 'build/client',
rollupOptions: {
input: {
loading: 'client/loading.html',
index: 'client/index.html',
},
},
},
},
})