module.exports ={
lintOnSave:false,
outputDir:‘dist‘,
assetsDir:‘static‘,
productionSourceMap:false,
publicPath:‘./‘ ,
devServer:{
open:true,
host:‘0.0.0.0‘,
// port:8083,
hotOnly:false,
proxy:{
// https://open.weixin.qq.com
‘/api‘:{
//服务器端接口地址
// target:‘http://192.168.0.155:8081‘,
target:‘http://192.168.0.107:8083‘,
// target:‘http://h5.u2sy.cn‘,
ws:true,
//是否跨域
changeOrigin:true,
pathRewrite:{
‘^/api‘:‘‘
}
}
}
}
}
原文:https://www.cnblogs.com/zjxzhj/p/15000443.html