-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
78 lines (76 loc) · 2.63 KB
/
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
///////////////////////////////////////////////////////////////////
// This file is only here to get webstorm to recognize aliases //
///////////////////////////////////////////////////////////////////
import { defineConfig, normalizePath } from 'vite';
import { resolve } from 'path';
import vue from '@vitejs/plugin-vue';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
export default defineConfig({
resolve: {
alias: [
{
find: '@renderer',
replacement: resolve(__dirname, 'src/renderer/src/main'),
},
{
find: /~(.+)/,
replacement: resolve(__dirname, 'node_modules') + '/$1',
},
{
find: 'vue-i18n',
replacement: 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js',
},
],
},
plugins: [
vue(),
viteStaticCopy({
targets: [
{
src: normalizePath(
resolve(
__dirname,
'node_modules/@fortawesome/fontawesome-free/webfonts/*',
),
),
dest: normalizePath(
resolve(__dirname, 'src/renderer/src/main/assets/webfonts'),
),
},
{
src: normalizePath(
resolve(
__dirname,
'node_modules/@fortawesome/fontawesome-free/webfonts/*',
),
),
dest: normalizePath(resolve(__dirname, 'out/renderer/assets/webfonts')),
},
{
src: normalizePath(resolve(__dirname, 'node_modules/@mdi/font/fonts/*')),
dest: normalizePath(
resolve(__dirname, 'src/renderer/src/main/assets/webfonts'),
),
},
{
src: normalizePath(resolve(__dirname, 'node_modules/@mdi/font/fonts/*')),
dest: normalizePath(resolve(__dirname, 'out/renderer/assets/webfonts')),
},
],
}),
VueI18nPlugin({
include: 'json',
jitCompilation: true,
runtimeOnly: true,
compositionOnly: true,
}),
],
build: {
rollupOptions: {
input: {
index: resolve(__dirname, 'src/renderer/index.html'),
},
},
},
});