-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
61 lines (55 loc) · 1.41 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
52
53
54
55
56
57
58
59
60
61
const { gitDescribe , gitDescribeSync } = require('git-describe');
process.env.VUE_APP_GIT_HASH = gitDescribeSync().hash;
module.exports = {
lintOnSave: false,
publicPath: process.env.NODE_ENV === 'production'
? '/vue-gbm-alive/'
: '/',
transpileDependencies: [
'vuetify',
],
chainWebpack: (config) => {
config
.plugin('html')
.tap((args) => {
args[0].meta = {
cache: { 'http-equiv': 'cache-control', content: 'no-cache' },
};
return args;
});
},
pwa: {
name: 'GBM alive',
themeColor: '#0186d1',
msTileColor: '#000000',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black',
workboxOptions: {
skipWaiting: true,
clientsClaim: true,
runtimeCaching: [{
urlPattern: new RegExp('json'),
handler: 'networkFirst',
options: {
networkTimeoutSeconds: 20,
cacheName: 'json-cache',
cacheableResponse: {
statuses: [0, 200],
},
},
}, {
urlPattern: new RegExp('jpg|png'),
handler: 'cacheFirst',
options: {
cacheName: 'wiki-cache',
expiration: {
maxEntries: 5000,
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days
// Automatically cleanup if quota is exceeded.
purgeOnQuotaError: true,
},
},
}],
},
},
};