forked from 17thshard/roshar-map
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vue.config.js
76 lines (71 loc) · 1.72 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
const path = require('path')
module.exports = {
productionSourceMap: false,
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('images')
.test(/\.(png|jpe?g|gif|webp|dds)(\?.*)?$/)
.end()
config.module
.rule('html-credits')
.resourceQuery(/vue&type=template/)
.use('credits-loader')
.loader(path.resolve('build/loaders/credits-loader.js'))
.end()
},
pwa: {
name: 'Interactive Map & Timeline of Roshar',
themeColor: '#0f3562',
msTileColor: '#0f3562',
manifestOptions: {
background_color: '#0f3562'
},
iconPaths: {
favicon32: null,
favicon16: null,
appleTouchIcon: null,
maskIcon: null,
msTileImage: null
},
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'
}
}
}
}