// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
port: 8081,
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css']
},
dev: {
env: require('./dev.env'),
port: 8080,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/mspapi/': {
target: 'http://172.16.11.197:8000',
changeOrigin: true,
pathRewrite: {
'^/mspapi/': '/'
}
},
'/sec_standard/':{
target:"http://172.16.11.197:8000",
changeOrigin:true
},
'^/apk_risk_':{
target:"http://172.16.11.197:8000",
changeOrigin:true
}
}
}
}
我看webpack里面配置
是这样的
proxy: [
{
path: //google(.*)/,
target: "http://www.google.com/"
}
],
但是 我用vue cli构建的项目
俩面 设置这个只有在 proxyTable里面这样设置
proxyTable: {
'/mspapi/': {
target: 'http://172.16.11.197:8000',
changeOrigin: true,
pathRewrite: {
'^/mspapi/': '/'
}
},
'/sec_standard/':{
target:"http://172.16.11.197:8000",
changeOrigin:true
},
'^/apk_risk_':{
target:"http://172.16.11.197:8000",
changeOrigin:true
}
}
最后一个是我 试试可不可以支持 正则
但好像不对
求指点
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…