-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvitePwaOptions.ts
More file actions
45 lines (44 loc) · 1.01 KB
/
vitePwaOptions.ts
File metadata and controls
45 lines (44 loc) · 1.01 KB
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
import { VitePWAOptions } from 'vite-plugin-pwa';
import { vitePwaManifest } from './vitePwaManifest';
export const vitePWAconfig: Partial<VitePWAOptions> = {
manifest: vitePwaManifest,
workbox: {
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'google-fonts-stylesheets',
},
},
{
urlPattern: /^https:\/\/fonts\.gstatic\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts-webfonts',
expiration: {
maxEntries: 30,
maxAgeSeconds: 60 * 60 * 24 * 365,
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
urlPattern: /^https:\/\/api(?:\.test)?\.profcomff\.com\/timetable\/.*/i,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'api-timetable',
expiration: {
maxEntries: 30,
maxAgeSeconds: 60 * 60 * 24 * 30,
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
};