webpack实现跨域(自用笔记)

1 在webpack.config中设置

devServer: {
contentBase: "./public",//本地服务器所加载的页面所在的目录
historyApiFallback: true,//不跳转
inline: true,//实时刷新,
// proxy: {
//  匹配的路径最终换换成下面的地址
// '/label-lifecycle-management/weixin': {
// target: 'https://jp.by-health.com', // 你最终访问的地址
// // pathRewrite: {'^/label-lifecycle-management/weixin' : ''},
// changeOrigin: true, // target是域名的话,需要这个参数,
// secure: true, // 设置支持https协议的代理
// },
// }
}
 
posted @ 2019-07-16 11:29  lxgwxq  阅读(267)  评论(0编辑  收藏  举报