generated from LiteLoaderQQNT/Plugin-Template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathelectron.vite.config.ts
84 lines (82 loc) · 2.03 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
// reference https://github.com/LLOneBot/LLOneBot/blob/main/electron.vite.config.ts
import cp from 'vite-plugin-cp';
import svgLoader from 'vite-svg-loader';
import vue from '@vitejs/plugin-vue';
import { viteSingleFile } from 'vite-plugin-singlefile';
const config = {
main: {
build: {
outDir: 'LiteLoaderQQNT-NekoImage/main',
minify: 'terser',
emptyOutDir: true,
lib: {
formats: ['cjs'],
entry: { main: 'src/main/main.ts' }
},
rollupOptions: {
input: 'src/main/main.ts'
}
},
plugins: [
cp({
targets: [
{ src: './manifest.json', dest: 'LiteLoaderQQNT-NekoImage' },
{ src: './icon.png', dest: 'LiteLoaderQQNT-NekoImage' },
{ src: 'src/renderer/setting/settings.html', dest: 'LiteLoaderQQNT-NekoImage' }
]
})
],
cssCodeSplit: true
},
preload: {
build: {
outDir: 'LiteLoaderQQNT-NekoImage/preload',
minify: 'terser',
emptyOutDir: true,
lib: {
formats: ['cjs'],
entry: { preload: 'src/preload/preload.ts' }
},
rollupOptions: {
input: 'src/preload/preload.ts'
}
},
resolve: {},
cssCodeSplit: true
},
renderer: {
// vite config options
build: {
outDir: 'LiteLoaderQQNT-NekoImage/renderer',
minify: 'terser',
emptyOutDir: true,
lib: {
formats: ['es'],
entry: { renderer: 'src/renderer/renderer.ts' }
},
rollupOptions: {
input: 'src/renderer/renderer.ts'
}
},
plugins: [
cp({
targets: [{ src: 'src/renderer/iframe/injectIframe.css', dest: 'LiteLoaderQQNT-NekoImage/renderer/' }]
}),
vue(),
svgLoader(),
viteSingleFile()
],
resolve: {
alias: {
vue: 'vue/dist/vue.runtime.esm-bundler.js',
'balm-ui-plus': 'balm-ui/dist/balm-ui-plus.esm.js',
'balm-ui-css': 'balm-ui/dist/balm-ui.css'
}
},
define: {
'process.env': {}
}
},
cssCodeSplit: true
};
export default config;