-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
36 lines (35 loc) · 1.41 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
const path = require('path');
function resolve (dir) {
return path.join(__dirname, dir)
}
module.exports = {
// 区分打包环境与开发环境
// process.env.NODE_ENV==='production' // (打包环境)
// process.env.NODE_ENV==='development' // (开发环境)
// baseUrl: process.env.NODE_ENV==='production'?"https://cdn.didabisai.com/front/":'front/',
publicPath: process.env.NODE_ENV==='production'?"http://101.200.164.208:8080":'./', // 用用程序默认部署位置,‘/’根目录,存放子目录ex:‘/web/’
outputDir: 'dist', // 输出文件目录
devServer: {
proxy: {
'/api': {
// // target: 'http://192.168.0.159:8080',
// // target: 'http://192.168.0.180:8080',
// // target: 'http://ihospital.doctoradmin.ebaiyihui.com',
target: 'http://101.200.164.208:8080',
ws: true,
changeOrigin:true,//允许跨域
pathRewrite: {
'^/api': ''
}
}
}
},
// 将接收ChainableConfig由webpack-chain提供支持的实例的函数。
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src'))
.set('style', resolve('src/assets/style'))
.set('img', resolve('src/assets/img'))
.set('components', resolve('src/components'))
}
};