0

当我配置我的 .roadhogrc 时,roadhog 的文档说我可以将“代理”属性设置为与webpack-dev-server#proxy相同。

我添加了一个“路由器”道具,然后由于“index.css”超时,我的页面无法加载。

那么,如何在 .roadhogrc 中使用“代理”?或者有什么方法可以改变 api 来测试 localhost 中的环境?

我找不到“dva”或“roadhog”标签,很抱歉使用“antd”标签。

{
  "entry": "src/index.js",
  "env": {
    "development": {
      "extraBabelPlugins": [
        "dva-hmr",
        "transform-runtime",
         ["import", { "libraryName": "antd", "style": "css" }]
      ],
      "proxy":{
        "router":{
          "http://api.eshop.corploft.com" : "http://test.corploft.com"
        }
      }
    },
    "production": {
      "extraBabelPlugins": [
        "transform-runtime",
        ["import", { "libraryName": "antd", "style": "css" }]
      ],
      "outputPath":"build/yijiayi"
    }
  }
}
4

1 回答 1

0

也许我讲了一个笑话...

所有代理和模拟设置都在本地主机网络上起作用,所以我只能将请求更改为本地服务器。如果我想更改对其他服务器的请求,以上所有设置都没有帮助。

SwitchyOmega(在 Chrome App Store 中)或ihosts可以提供帮助。

于 2017-06-13T09:00:59.063 回答