-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathvue.config.js
More file actions
71 lines (70 loc) · 2.27 KB
/
Copy pathvue.config.js
File metadata and controls
71 lines (70 loc) · 2.27 KB
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
const publicPath = '/'
const assetsVersion = process.env.VUE_APP_ICONS_VERSION || ''
const assetsVersionSuffix = assetsVersion ? `?v=${assetsVersion}` : ''
module.exports = {
publicPath: publicPath,
// https://cli.vuejs.org/core-plugins/pwa.html#configuration
pwa: {
name: '蚁阅',
workboxPluginMode: 'GenerateSW',
workboxOptions: {
// https://github.com/GoogleChrome/workbox/releases
// https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin
importWorkboxFrom: 'local',
importsDirectory: 'libs',
exclude: [/\.map$/, /^manifest.*\.js$/, /libs\/MathJax-.*$/],
// https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.generateSW
navigateFallback: publicPath + 'index.html',
navigateFallbackBlacklist: [/^\/api.*$/, /^\/admin.*$/, /^\/changelog.*$/, /^.*\..*$/],
},
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-plugin-pwa/lib/HtmlPwaPlugin.js
themeColor: '#FFFFFF',
msTileColor: '#FFFFFF',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'default',
assetsVersion: assetsVersion,
manifestPath: 'manifest.json',
manifestOptions: {
start_url: publicPath,
icons: [
{
src: `${publicPath}img/icons/android-chrome-192x192.png${assetsVersionSuffix}`,
sizes: '192x192',
type: 'image/png',
},
{
src: `${publicPath}img/icons/android-chrome-512x512.png${assetsVersionSuffix}`,
sizes: '512x512',
type: 'image/png',
},
],
background_color: '#FFFFFF',
},
iconPaths: {
// will auto prefix '/' and auto add assetsVersion
favicon32: null,
favicon16: null,
appleTouchIcon: 'img/icons/apple-touch-icon.png',
maskIcon: 'img/icons/safari-pinned-tab.svg',
msTileImage: 'img/icons/msapplication-icon-150x150.png',
},
},
devServer: {
port: 6789,
disableHostCheck: true,
proxy: {
'/api/v1/image': {
target: 'http://127.0.0.1:6786',
},
'/api': {
target: 'http://127.0.0.1:6788',
},
'/static': {
target: 'http://127.0.0.1:6788',
},
'/changelog': {
target: 'http://127.0.0.1:6788',
},
},
},
}