-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
46 lines (43 loc) · 1022 Bytes
/
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
const path = require('path');
function resolve (dir) {
return path.join(__dirname, dir)
}
module.exports = {
lintOnSave: false,
configureWebpack: {
resolve: {
alias: {
'@assets': resolve('src/assets'),
'@components': resolve('src/components'),
'@views': resolve('src/views'),
'@css': resolve('src/assets/css')
}
},
devServer: {
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
proxy: {
'/api': {
/* 目标代理服务器地址 */
target: 'https://www.liulianjun.top/api',
/* 允许跨域 */
changeOrigin: true,
pathRewrite:{
'^/api':''
}
},
'/weather': {
/* 目标代理服务器地址 */
target: 'https://free-api.heweather.net',
/* 允许跨域 */
changeOrigin: true,
pathRewrite:{
'^/weather':''
}
},
}
},
},
};