forked from johnsusek/praeco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
61 lines (60 loc) · 1.48 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
const webpack = require('webpack');
module.exports = {
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('istanbul-instrumenter-loader')
.loader('istanbul-instrumenter-loader')
.options({ esModules: true })
.end();
}
},
devServer: {
host: '0.0.0.0',
hot: true,
disableHostCheck: true,
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': ''
}
}
}
}
};