forked from Flysky12138/PicW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.pwa.ts
47 lines (45 loc) · 1023 Bytes
/
vite.config.pwa.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
import type { VitePWAOptions } from 'vite-plugin-pwa'
const pwaConfig: Partial<VitePWAOptions> = {
registerType: 'prompt',
workbox: {
navigateFallback: null,
runtimeCaching: [
{
urlPattern: ({ request }) => request.destination == 'image',
handler: 'CacheFirst',
options: {
cacheName: 'image-cache'
}
},
{
urlPattern: ({ request }) => request.destination == 'font',
handler: 'CacheFirst',
options: {
cacheName: 'font-cache'
}
}
]
},
devOptions: {
enabled: false
},
manifest: {
name: 'PicW',
short_name: 'PicW',
description: 'A site for uploading images to github',
theme_color: '#ffffff',
icons: [
{
src: 'pwa/android-chrome-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: 'pwa/android-chrome-512x512.png',
sizes: '512x512',
type: 'image/png'
}
]
}
}
export default pwaConfig