forked from 17thshard/roshar-map
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
63 lines (59 loc) · 1.43 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
const path = require('path')
module.exports = {
chainWebpack: (config) => {
config.resolveLoader
.modules
.add(path.resolve(__dirname, 'build/loaders'))
.end()
config.module
.rule('images')
.use('url-loader')
.loader('url-loader')
.tap((options) => {
options.fallback.options.context = './src/assets'
options.fallback.options.name = 'img/[path][name].[hash:8].[ext]'
return options
})
.end()
config.module
.rule('html-credits')
.resourceQuery(/vue&type=template/)
.use('credits-loader')
.loader(path.resolve('build/loaders/credits-loader.js'))
.end()
},
pwa: {
name: 'Roshar Map',
themeColor: '#0f3562',
msTileColor: '#0f3562',
manifestOptions: {
background_color: '#0f3562'
},
workboxOptions: {
skipWaiting: true,
clientsClaim: true,
exclude: ['index.html', /.*\/textures\/.*\.(webp|png)$/, /.*\/lang-.*\.js/],
runtimeCaching: [
{
urlPattern: /^$|^\/$|\/#.*$/,
handler: 'NetworkFirst'
},
{
urlPattern: /.*\/textures\/.*\.(webp|png)$/,
handler: 'CacheFirst'
},
{
urlPattern: /.*\/?js\/lang-.*\.js/,
handler: 'CacheFirst'
}
]
}
},
pluginOptions: {
ifdefConfig: {
context: {
MAP_DEBUG: process.env.MAP_DEBUG === 'true'
}
}
}
}