-
Notifications
You must be signed in to change notification settings - Fork 9
/
vue.config.js
executable file
·56 lines (52 loc) · 1.49 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
const consoleInfo = require('./console');
// 配置跨域
const proUrlObj = {
// 测试
// target: 'http://168.130.1.33:8097'
// 线上
target: 'http://server.maxiaoqu.com/'
};
module.exports = {
publicPath: './',
lintOnSave: process.env.NODE_ENV !== 'production',
outputDir: process.env.outputDir,
productionSourceMap: false,
filenameHashing: false,
configureWebpack: config => {
config.module.rules.push({
test: /\.md$/,
loader: 'raw-loader'
});
},
chainWebpack: config => {
if (process.env.NODE_ENV === 'production') {
if (process.env.npm_config_report) {
config
.plugin('webpack-bundle-analyzer')
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
.end();
config.plugins.delete('prefetch');
}
}
},
devServer: {
port: 1111,
host: 'localhost',
https: false,
open: true,
proxy: {
// 通配【勿动】
'/maxiaoqu': {
target: 'http://168.168.168.168:8888/maxiaoqu',
changeOrigin: true,
pathRewrite: {
'/maxiaoqu': '/'
}
},
// 联调时的跨域【可进行增加和修改】
'/auth': proUrlObj,
// 通用统一验证跨域【只可改IP】
'/zuul': proUrlObj,
},
}
}