-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathvue.config.js
89 lines (86 loc) · 2.73 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
// const CleanWebpackPlugin = require('clean-webpack-plugin');
// const HtmlWebpackPlugin = require('html-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
module.exports = {
publicPath: './',
outputDir: 'docs',
lintOnSave: true,
runtimeCompiler: false,
chainWebpack: config => {
config
.plugin('html')
.tap(args => {
args[0].title = '大声朗读'
return args
})
},
configureWebpack: () => {
plugins: [
// new CleanWebpackPlugin(['docs']),
// new HtmlWebpackPlugin({
// title: '渐进式网络应用程序'
// }),
new WorkboxPlugin.GenerateSW({
// 这些选项帮助快速启用 ServiceWorkers
// 不允许遗留任何“旧的” ServiceWorkers
clientsClaim: true,
skipWaiting: true
})
]
},
devServer: {
// 略...
},
css: {
loaderOptions: {
less: {
lessOptions: {
// If you are using less-loader@5 please spread the lessOptions to options directly
modifyVars: {
'primary-color': '#666',
'switch-color': '#666',
'switch-shadow-color': 'rgba(0,0,0,0.1)',
'link-color': '#ccc',
// 'border-radius-base': '4px',
'slider-handle-background-color': '#ccc',
'slider-rail-background-color': '#eee',
'select-item-selected-bg': '#ccc'
},
javascriptEnabled: true,
},
},
},
},
pwa: {
name: '大声朗读',
themeColor: '#666',
msTileColor: '#000000',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'default',
manifestPath: './public/manifest.json',
// configure the workbox plugin
workboxPluginMode: 'InjectManifest',
// workboxPluginMode: 'GenerateSW',
workboxOptions: {
// swSrc is required in InjectManifest mode.
// swSrc: 'src/service-worker.js',
swSrc: './src/sw.js',
// navigateFallback: '/index.html',
// runtimeCaching: [
// {
// urlPattern: new RegExp('^https://guozhigq.io'),
// handler: 'networkFirst',
// options: {
// networkTimeoutSeconds: 20,
// cacheName: 'api-cache',
// cacheableResponse: {
// statuses: [0, 200]
// }
// }
// }
// ]
// ...other Workbox options...
}
}
// ......
};