我在webpack.dev.config中配置了
devServer: {
contentBase: path.join(__dirname, './dist'),
historyApiFallback: true,
host: '0.0.0.0',
proxy: {
'/api/weixin/**': {
target: 'https://api.mch.weixin.qq.com',
pathRewrite: {'^/api/weixin': ''},
secure: false, // 接受 运行在 https 上的服务
changeOrigin: true
}
}
}
相应的 在webpak.config.js中我需要如何修改才能支持生产环境中实现跨域