forked from arkntools/arknights-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
153 lines (153 loc) · 4.09 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
module.exports = {
publicPath: '',
assetsDir: 'assets',
productionSourceMap: false,
crossorigin: 'anonymous',
configureWebpack: {
performance: {
hints: false,
},
optimization: {
splitChunks: {
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all',
enforce: true,
},
data_common: {
test: /[\\/]src[\\/]data[\\/](item|level)\.json/,
name: 'data/common',
chunks: 'all',
enforce: true,
},
data: {
test: /[\\/]src[\\/]data[\\/](?!(item|level)\.json).+\.json/,
name: 'data/data',
chunks: 'all',
minSize: 1,
maxSize: 2,
priority: 1,
},
i18n_common: {
test: /[\\/]src[\\/]locales[\\/][a-z]+[\\/](item|material|tag)\.json/,
name: 'i18n/common',
chunks: 'all',
enforce: true,
},
i18n: {
test: /[\\/]src[\\/]locales[\\/][a-z]+[\\/](?!(item|material|tag)\.json).+\.json/,
name: 'i18n/i18n',
chunks: 'all',
minSize: 1,
maxSize: 2,
},
},
},
},
externals: {
lodash: '_',
vue: 'Vue',
'vue-router': 'VueRouter',
mdui: 'mdui',
'vue-i18n': 'VueI18n',
'vue-lazyload': 'VueLazyload',
},
},
chainWebpack: config => {
config.module
.rule('i18n')
.resourceQuery(/blockType=i18n/)
.type('javascript/auto')
.use('i18n')
.loader('@kazupon/vue-i18n-loader')
.end();
},
pwa: {
workboxPluginMode: 'GenerateSW',
workboxOptions: {
skipWaiting: true,
exclude: [/\.map$/, /^manifest.*\.js$/, /^assets\/img\/(avatar|material)\//, /^robots\.txt/],
runtimeCaching: [
{
urlPattern: /assets\/img\/(avatar|material)\//,
handler: 'CacheFirst',
options: {
cacheableResponse: {
statuses: [200],
},
},
},
{
urlPattern: /^https:\/\/cdn\.jsdelivr\.net\//,
handler: 'CacheFirst',
options: {
cacheableResponse: {
statuses: [200],
},
},
},
],
},
name: '明日方舟工具箱',
themeColor: '#212121',
msTileColor: '#212121',
appleMobileWebAppStatusBarStyle: 'black',
iconPaths: {
favicon32: 'assets/icons/favicon-32x32.png',
favicon16: 'assets/icons/favicon-16x16.png',
appleTouchIcon: 'assets/icons/apple-touch-icon.png',
msTileImage: 'assets/icons/msapplication-icon-144x144.png',
maskIcon: 'assets/icons/mask-icon.svg',
},
manifestOptions: {
name: '明日方舟工具箱',
short_name: '方舟工具箱',
lang: 'zh-Hans',
background_color: '#212121',
description:
'明日方舟工具箱,宗旨是简洁美观且对移动设备友好。目前功能包括:公开招募计算、精英材料计算、干员升级计算、基建技能筛选。',
icons: [
{
src: './assets/icons/apple-touch-icon-57x57.png',
sizes: '57x57',
type: 'image/png',
},
{
src: './assets/icons/apple-touch-icon-72x72.png',
sizes: '72x72',
type: 'image/png',
},
{
src: './assets/icons/apple-touch-icon-114x114.png',
sizes: '114x114',
type: 'image/png',
},
{
src: './assets/icons/apple-touch-icon-144x144.png',
sizes: '144x144',
type: 'image/png',
},
{
src: './assets/icons/android-chrome-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: './assets/icons/android-chrome-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
},
},
pluginOptions: {
i18n: {
locale: 'zh',
fallbackLocale: 'zh',
localeDir: 'locales',
enableInSFC: true,
},
},
};