-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathelectron.vite.config.ts
61 lines (60 loc) · 1.42 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
import { PrimeVueResolver } from '@primevue/auto-import-resolver'
import vue from '@vitejs/plugin-vue'
import { bytecodePlugin, defineConfig, externalizeDepsPlugin } from 'electron-vite'
import * as path from 'path'
import Components from 'unplugin-vue-components/vite'
import { normalizePath } from 'vite'
import { viteStaticCopy } from 'vite-plugin-static-copy'
export default defineConfig({
main: {
build: {
rollupOptions: {
output: {
format: 'cjs'
}
}
},
plugins: [bytecodePlugin(), externalizeDepsPlugin()]
},
preload: {
plugins: [
externalizeDepsPlugin(),
...(process.platform === 'win32' && process.env.npm_lifecycle_event !== 'build'
? [
viteStaticCopy({
targets: [
{
src: normalizePath(path.resolve(import.meta.dirname, 'out/libOpenCOR.dll')),
dest: 'chunks'
}
]
})
]
: [])
]
},
renderer: {
build: {
target: 'esnext'
},
define: {
__APP_VERSION__: JSON.stringify(process.env.npm_package_version)
},
optimizeDeps: {
esbuildOptions: {
target: 'esnext'
}
},
plugins: [
vue(),
Components({
resolvers: [PrimeVueResolver()]
})
],
server: {
fs: {
allow: [path.join(import.meta.dirname, '..')]
}
}
}
})