-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelectron.vite.config.ts
88 lines (87 loc) · 1.97 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import { resolve } from 'node:path'
import { defineConfig, externalizeDepsPlugin, swcPlugin } from 'electron-vite'
import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin(), swcPlugin()],
build: {
rollupOptions: {
output: {
format: 'es',
},
},
},
resolve: {
alias: {
'@main': resolve('src/main'),
'@preload': resolve('src/preload'),
'@type': resolve('src/types'),
},
},
},
preload: {
plugins: [externalizeDepsPlugin(), swcPlugin()],
build: {
rollupOptions: {
input: {
blive: 'src/preload/blive.ts',
main: 'src/preload/main.ts',
biliHome: 'src/preload/biliHome.ts',
},
output: {
format: 'es',
},
},
},
resolve: {
alias: {
'@main': resolve('src/main'),
'@preload': resolve('src/preload'),
'@type': resolve('src/types'),
},
},
},
renderer: {
resolve: {
alias: {
'@renderer': resolve('src/renderer/src'),
'@type': resolve('src/types'),
},
},
plugins: [
vue(),
UnoCSS({
configFile: './uno.config.{js,ts,mjs,mts}',
}),
AutoImport({
dts: true,
imports: [
'vue',
{
'naive-ui': ['useDialog', 'useMessage', 'useNotification', 'useLoadingBar'],
},
],
}),
Components({
resolvers: [NaiveUiResolver()],
}),
],
esbuild: {
drop: ['console', 'debugger'],
},
build: {
rollupOptions: {
output: {
manualChunks: {
pinyin: ['pinyin-pro'],
ui: ['naive-ui'],
},
},
},
},
},
})