-
Notifications
You must be signed in to change notification settings - Fork 88
/
vue.config.js
62 lines (61 loc) · 1.58 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
const webpack = require('webpack');
module.exports = {
publicPath: process.env.VUE_APP_BASE_URL ? process.env.VUE_APP_BASE_URL : '/',
configureWebpack: {
devtool: process.env.NODE_ENV === 'coverage' ? 'eval' : undefined,
performance: {
hints: false
},
plugins: [
new webpack.EnvironmentPlugin({ LATER_COV: false }),
new webpack.NormalModuleReplacementPlugin(
/element-ui[/\\]lib[/\\]locale[/\\]lang[/\\]zh-CN/,
'element-ui/lib/locale/lang/en'
)
]
},
chainWebpack: config => {
if (process.env.NODE_ENV !== 'production') {
config.module
.rule('istanbul')
.test(/\.(js|vue)$/)
.enforce('post')
.include.add(`${__dirname}apollo-server`)
.add(`${__dirname}src`)
.end()
.use('@jsdevtools/coverage-istanbul-loader')
.loader('@jsdevtools/coverage-istanbul-loader')
.options({ esModules: true })
.end();
}
},
devServer: {
host: '0.0.0.0',
hot: true,
allowedHosts: ['all'],
proxy: {
'/api-app/releases': {
target: 'https://api.github.com/repos/johnsusek/praeco/releases',
changeOrigin: true,
pathRewrite: {
'^/api-app/releases': ''
}
},
'/api-ws/test': {
target: 'http://localhost:3333/',
ws: true,
changeOrigin: true,
pathRewrite: {
'^/api-ws/test': '/test'
}
},
'/api': {
target: 'http://localhost:3030/',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
}
};