-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.ts
101 lines (99 loc) · 2.29 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { buildTime } from 'star-rail-vue/vite'
import AutoImport from 'unplugin-auto-import/vite'
import { defineConfig } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
import VueDevTools from 'vite-plugin-vue-devtools'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
buildTime(),
vue({
script: {
defineModel: true
}
}),
vueJsx(),
AutoImport({
imports: ['vue']
}),
VueDevTools(),
VitePWA({
mode: 'production',
injectRegister: 'auto',
registerType: 'prompt',
manifest: {
id: '/',
name: '黑神话:悟空 - 影神图',
short_name: '影神图',
description: '黑神话:悟空影神图生成器',
display: 'fullscreen',
orientation: 'landscape',
theme_color: '#000',
background_color: '#000',
lang: 'zh-cn',
icons: [
{
src: 'icon.webp',
type: 'image/webp',
sizes: '256x256'
}
],
screenshots: [
{
src: 'preview.webp',
sizes: '1000x565'
},
{
src: 'preview.webp',
sizes: '1000x565',
form_factor: 'wide'
}
]
},
workbox: {
// skipWaiting: true,
disableDevLogs: true,
runtimeCaching: [
{
urlPattern: /(.*?)\.(png|jpe?g|svg|gif|bmp|psd|tiff|tga|eps|ico|webp)/i,
handler: 'CacheFirst',
options: {
cacheName: 'image-cache'
}
},
{
urlPattern: /(.*?)\.(woff2)/i,
handler: 'CacheFirst',
options: {
cacheName: 'font-cache'
}
}
]
},
devOptions: {
enabled: true,
suppressWarnings: true
}
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
rollupOptions: {
output: {
manualChunks: {
vue: ['vue'],
sr: ['star-rail-vue']
}
}
},
assetsInlineLimit: 1024 * 200,
chunkSizeWarningLimit: 1024
}
})