-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathelectron.vite.config.ts
69 lines (68 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
import { fileURLToPath, URL } from 'node:url'
import vueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import vueDevTools from 'vite-plugin-vue-devtools'
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
import tsconfigPaths from 'vite-tsconfig-paths'
import main from './vite.config'
export default defineConfig({
main,
preload: {
plugins: [
externalizeDepsPlugin(),
tsconfigPaths({
projects: [fileURLToPath(new URL('./tsconfig.node.json', import.meta.url))],
loose: true
})
],
esbuild: {
target: ['chrome126']
},
resolve: {
alias: {
buffer: fileURLToPath(new URL('./node_modules/buffer', import.meta.url)),
stream: fileURLToPath(new URL('./node_modules/stream-browserify', import.meta.url)),
util: fileURLToPath(new URL('./node_modules/util', import.meta.url))
}
}
},
renderer: {
plugins: [
tsconfigPaths({
projects: [fileURLToPath(new URL('./tsconfig.web.json', import.meta.url))],
loose: true
}),
vue({ template: { transformAssetUrls } }),
vueJsx(),
vuetify(),
vueDevTools(),
vueI18nPlugin({
runtimeOnly: false,
include: [
'src/renderer/locales/**/*.json',
'src/renderer/locales/**/*.json5',
'src/renderer/locales/**/*.yaml',
'src/renderer/locales/**/*.yml'
]
}) as never
],
esbuild: {
target: ['chrome126']
},
resolve: {
alias: {
buffer: fileURLToPath(new URL('./node_modules/buffer', import.meta.url)),
stream: fileURLToPath(new URL('./node_modules/stream-browserify', import.meta.url)),
util: fileURLToPath(new URL('./node_modules/util', import.meta.url))
}
},
css: {
preprocessorOptions: {
sass: { api: 'modern-compiler' },
scss: { api: 'modern-compiler' }
}
}
}
})