forked from Hanxven/LeagueAkari
-
Notifications
You must be signed in to change notification settings - Fork 0
/
electron.vite.config.ts
77 lines (74 loc) · 1.56 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
import vue from '@vitejs/plugin-vue'
import { defineConfig, externalizeDepsPlugin, swcPlugin } from 'electron-vite'
import { resolve } from 'path'
const minify = true
// 在解析 League Client 的标签时,需要考虑到这些自创的元素
// 作为参考,列在下面,同时供模板使用
// 暂未实装
const leagueClientCustomTags = new Set([
'mainText',
'stats',
'active',
'passive',
'attention',
'rarityMythic',
'rarityLegendary',
'rarityGeneric',
'keywordStealth', // 隐形
'scaleArmor',
'scaleMR',
'scaleAD',
'scaleAP',
'feSteal', // 物理吸血
'flavorText', // 小字彩蛋
'rules',
'status',
'speed',
'shield',
'heang', // 似乎是和治疗相关的,回复生命值
'scaleMana',
'scalemana', // 不知道为什么有小写的,虽然在 HTML 中都会看作小写
'magicDamage',
'trueDamage',
'physicalDamage',
'ornnBonus',
'buffedStat',
'nerfedStat',
'keywordMajor' // 关键词护卫
])
export default defineConfig({
main: {
plugins: [swcPlugin(), externalizeDepsPlugin()],
build: {
minify
}
},
preload: {
plugins: [swcPlugin(), externalizeDepsPlugin()],
build: {
minify
}
},
renderer: {
resolve: {
alias: {
'@renderer': resolve('src/renderer/src')
}
},
plugins: [
swcPlugin(),
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => {
return leagueClientCustomTags.has(tag)
}
}
}
})
],
build: {
minify
}
}
})