-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
wb.config.js
50 lines (50 loc) · 1.23 KB
/
wb.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
module.exports = {
disable: process.env.NODE_ENV === 'development',
dest: 'public',
register: process.env.NODE_ENV !== 'development',
scope: '/',
sw: 'service-worker.js',
buildExcludes: ['/robots.txt', '/sitemap.xml', '/google254ec9b78a3c3c38.html', /\/images\/.*$/],
runtimeCaching: [
{
urlPattern: /^https:\/\/oirhwazlkofldqlyoamp\.supabase\.co\//,
handler: 'NetworkFirst'
},
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\//,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'google-fonts-stylesheets'
}
},
{
urlPattern: /^https:\/\/fonts\.gstatic\.com\//,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts-webfonts',
expiration: {
maxAgeSeconds: 60 * 60 * 24 * 365,
maxEntries: 200
}
}
},
{
urlPattern: /.(png|jpg|jpeg|webp|svg|woff|woff2)$/,
handler: 'CacheFirst',
options: {
cacheName: 'assets',
expiration: {
maxAgeSeconds: 60 * 60 * 24 * 365,
maxEntries: 200
}
}
},
{
urlPattern: /.(js|css)$/,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'js-css'
}
}
]
}