vue 打包 以及跨域问题组织

config  > index 
proxyTable: {
'/api': {
// target: "http://www.yjy100.cn/",
target: "http://192.168.0.240/",
changeOrigin: true,
pathRewrite: {
'^/api': '/'
}
}
},
跨域
 
build > utils
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader',
publicPath:'../../'
})
}
静态资源打包
config  > index 
assetsPublicPath: './',
 
 

猜你喜欢

转载自www.cnblogs.com/liuliang389897172/p/10373811.html