Webpack DevServer配置多个反向代理

2,231 阅读1分钟

Webpack DevServer配置多个反向代理

devServer: {
  historyApiFallback: true,
  proxy: {
    "/is": {
      target: "http://is.xxx.com",
      pathRewrite: { "^/is": "" }
    },
    "/api": {
      target: "http://m.xxx.com",
      pathRewrite: { "^/api": "/api" }
    }
  }
}