-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvue.config.js
54 lines (51 loc) · 1.18 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
const webpack = require('webpack');
module.exports = {
pwa: {
name: 'UVue',
themeColor: '#ffffff',
msTileColor: '#333333',
workboxOptions: {
skipWaiting: true,
templatedUrls: {
'/': '/uvue/spa.html',
},
runtimeCaching: [
// Cache Google fonts
{
urlPattern: /https:\/\/fonts.(googleapis|gstatic).com\/(.*)/,
handler: 'cacheFirst',
options: {
cacheName: 'googleapis',
cacheableResponse: { statuses: [0, 200] },
},
},
// Cache API calls
{
urlPattern: /\/api\//,
handler: 'networkFirst',
options: {
cacheName: 'api',
cacheableResponse: { statuses: [0, 200] },
},
},
],
},
},
chainWebpack(chain) {
chain.module
.rule('html')
.test(/\.html$/)
.exclude.add([/index\.html/])
.end()
.use('html')
.loader('html-loader')
.options({
minimize: true,
});
chain.plugin('DefinePluginHeroku').use(webpack.DefinePlugin, [
{
'process.env.API_URL': JSON.stringify(process.env.API_URL),
},
]);
},
};