This repository was archived by the owner on Mar 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathvue.config.js
73 lines (72 loc) · 1.92 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
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = ['js', 'css']
module.exports = {
assetsDir: 'static',
pages: {
app: {
entry: 'src/app.js',
template: 'public/app.html',
filename: 'app.html',
},
auth: {
entry: 'src/auth.js',
template: 'public/auth.html',
filename: 'auth.html',
},
admin: {
entry: 'src/admin.js',
template: 'public/admin.html',
filename: 'admin.html',
},
},
devServer: {
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true
}
},
before: function (app) {
app.get('/app', function (req, res) { res.redirect('/app.html') })
app.get('/auth', function (req, res) { res.redirect('/auth.html') })
app.get('/login', function (req, res) { res.redirect('/auth.html') })
app.get('/admin', function (req, res) { res.redirect('/admin.html') })
app.get('/press', function (req, res) { res.redirect('/press/press.html') })
}
},
configureWebpack: {
plugins: [
new CompressionWebpackPlugin({
filename: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
threshold: 10240,
minRatio: 0.8
})
]
},
chainWebpack: config => {
config.plugin('copy')
.tap(args => {
args[0][0].ignore = [
'.DS_Store',
'public/app.html',
'public/auth.html',
'public/admin.html'
]
return args
})
},
pwa: {
workboxPluginMode: 'GenerateSW',
name: 'Edward the App',
themeColor: '#BFEADA',
assetsVersion: '20181003',
iconPaths: {
favicon32: 'img/edward-favicon_32.png',
favicon16: 'img/edward-favicon_16.png',
appleTouchIcon: 'img/edward-favicon_152.png',
msTileImage: 'img/edward-favicon_144.png'
}
}
}