-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
31 lines (28 loc) · 949 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
const path = require('path')
// const apiRoot = process.env.NODE_ENV === 'development' ? '' : '101.42.242.59:80'
// const apiRoot = process.env.NODE_ENV === 'development' ? 'http://mock.eyesky.site/mock/11' : '101.42.242.59:80'
function resolve (dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
devServer: {
proxy: {
'/': {
target: 'http://101.42.242.59:80/api/', // 对应自己的接口 http://www.mock.eyesky.site/mock/11
changeOrigin: true,
ws: false
}
}
},
chainWebpack: (config) => {
config.resolve.alias
.set('@', resolve('src'))
.set('api', resolve('src/api'))
.set('assets', resolve('src/assets'))
.set('components', resolve('src/components'))
.set('views', resolve('src/views'))
.set('config', resolve('src/config'))
.set('utils', resolve('src/utils'))
}
}