This repository has been archived by the owner on Feb 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
vue.config.js
89 lines (89 loc) · 2.55 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:4000',
changeOrigin: true,
pathRewrite: {
'^/api': '',
},
},
},
},
productionSourceMap: false,
pwa: {
name: 'Daily Go',
themeColor: '#393C3E',
msTileColor: '#393C3E',
iconPaths: {
favicon32: 'img/icons/icon-32x32.png',
favicon16: 'img/icons/icon-16x16.png',
appleTouchIcon: 'img/icons/icon-152x152.png',
msTileImage: 'img/icons/icon-144x144.png',
},
workboxOptions: {
exclude: [/_redirects$/],
runtimeCaching: [
{
// eslint-disable-next-line no-useless-escape
urlPattern: new RegExp('^https:\/\/(storage\.googleapis\.com\/devkit-assets\/images|res\.cloudinary\.com\/daily-now\/image\/upload\/.*\/v1\/posts)\/.*'),
method: 'GET',
handler: 'cacheFirst',
options: {
cacheName: 'post-images',
expiration: {
// 7 days
maxAgeSeconds: 604800,
},
},
},
{
// eslint-disable-next-line no-useless-escape
urlPattern: new RegExp('^https://(storage\.googleapis\.com\/devkit-assets\/ads|res\.cloudinary\.com/daily-now/image/upload/.*/v1/ads)/.*'),
method: 'GET',
handler: 'cacheFirst',
options: {
cacheName: 'ads-images',
expiration: {
// 7 days
maxAgeSeconds: 604800,
},
},
},
{
// eslint-disable-next-line no-useless-escape
urlPattern: new RegExp('^https://res\.cloudinary\.com/daily-now/image/upload/.*/v1/logos/.*'),
method: 'GET',
handler: 'cacheFirst',
options: {
cacheName: 'pubs-logos',
},
},
{
urlPattern: 'https://www.google-analytics.com/analytics.js',
handler: 'cacheFirst',
},
{
urlPattern: new RegExp('https://ajax.googleapis.com/ajax/libs/webfont/.*'),
method: 'GET',
handler: 'cacheFirst',
},
{
urlPattern: new RegExp('https://storage.googleapis.com/devkit-assets/static/.*'),
method: 'GET',
handler: 'cacheFirst',
},
{
urlPattern: '/',
method: 'GET',
handler: 'networkFirst',
},
{
urlPattern: new RegExp('^/(home|toilet|login|oauth|notSupported).*'),
method: 'GET',
handler: 'networkFirst',
},
],
},
},
};