This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
51 lines (50 loc) · 1.62 KB
/
vue.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
let endpoint = '^' + process.env.VUE_APP_API_URL;
module.exports = {
pwa: {
name: 'SIMCALEG',
themeColor: '#fff',
msTileColor: '#009688',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'default',
workboxPluginMode: 'GenerateSW',
workboxOptions: {
navigateFallback: '/index.html',
runtimeCaching: [
{
urlPattern: /\.(?:png|jpg|jpeg|svg)$/,
handler: 'cacheFirst',
options: {
cacheName: 'images',
expiration: {
maxEntries: 10,
},
},
},
{
urlPattern: new RegExp(endpoint),
handler: 'networkFirst',
options: {
networkTimeoutSeconds: 20,
cacheName: 'api-cache',
cacheableResponse: {
statuses: [0, 200]
}
}
},
{
urlPattern: new RegExp(endpoint),
handler: 'networkOnly',
options: {
backgroundSync: {
name: 'post-queue',
options: {
maxRetentionTime: 24 * 60,
}
},
},
method: 'POST'
}
]
}
}
}