-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathelectron.vite.config.ts
46 lines (44 loc) · 1.01 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
import * as primeVueAutoImportResolver from '@primevue/auto-import-resolver'
import vuePlugin from '@vitejs/plugin-vue'
import * as electronVite from 'electron-vite'
import * as path from 'path'
import vitePlugin from 'unplugin-vue-components/vite'
export default electronVite.defineConfig({
main: {
build: {
rollupOptions: {
output: {
format: 'cjs'
}
}
},
plugins: [electronVite.bytecodePlugin(), electronVite.externalizeDepsPlugin()]
},
preload: {
plugins: [electronVite.externalizeDepsPlugin()]
},
renderer: {
build: {
target: 'esnext'
},
define: {
__APP_VERSION__: JSON.stringify(process.env.npm_package_version)
},
optimizeDeps: {
esbuildOptions: {
target: 'esnext'
}
},
plugins: [
vuePlugin(),
vitePlugin({
resolvers: [primeVueAutoImportResolver.PrimeVueResolver()]
})
],
server: {
fs: {
allow: [path.join(import.meta.dirname, '..')]
}
}
}
})