-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.js
98 lines (96 loc) · 2.15 KB
/
vite.config.js
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
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import viteCompression from 'vite-plugin-compression'
import viteImagemin from 'vite-plugin-imagemin'
import { VitePWA } from 'vite-plugin-pwa'
// https://vitejs.dev/config/
export default defineConfig({
build: {
assetsInlineLimit: 1145141919810,
minify: 'esbuild'
},
plugins: [
vue(),
vueJsx(),
viteImagemin({
gifsicle: {
optimizationLevel: 7,
interlaced: false
},
optipng: {
optimizationLevel: 7
},
mozjpeg: {
quality: 20
},
pngquant: {
quality: [0.8, 0.9],
speed: 4
},
svgo: {
plugins: [
{
name: 'removeViewBox'
},
{
name: 'removeEmptyAttrs',
active: false
}
]
}
}),
VitePWA({
mode: 'production',
base: '/',
registerType: 'prompt',
injectRegister: 'auto',
workbox: {
runtimeCaching: [
{
urlPattern: /.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'ba-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 30
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
},
manifest: {
name: 'BlueArchive-CuteChibi',
short_name: 'CuteChibi',
description: 'A project to select the Chibi in Blue Archive.',
theme_color: '#128AFA',
start_url: '/',
id: 'CuteChibi',
icons: [
{
src: '/favicon512.png',
sizes: '512x512',
purpose: 'any maskable'
},
{
src: '/favicon144.png',
sizes: '144x144'
}
]
}
}),
viteCompression({
threshold: 10240 // the unit is Bytes
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})