【发布时间】:2018-01-16 04:08:17
【问题描述】:
我刚刚使用 create-react-app 创建了一个反应应用程序,该应用程序从端口 3000 开始,很好。我想使用前缀访问应用程序,在我的例子中是 /node 和端口 80,即http://localhost/node。为此,我已将 apache 配置为:
<Location /node>
Allow from all
ProxyPass http://localhost:3000/ retry=0
ProxyPassReverse http://localhost:3000/
</Location>
部分工作,我可以访问http://localhost/node,但页面无法正确加载,因为捆绑的路径是静态的。在控制台上签名我看到请求http://localhost/static/js/bundle.js 失败并没有找到。
bundle.js 不在 index.html 中,所以应该是 webpack 注入的。
我一直在寻找在哪里配置 webpack 以更改配置以将 bundle.js 放在 node/static/js/bundle.js 或类似的东西下。
【问题讨论】:
标签: reactjs