create-react-app 和 url 开发服务器的基本路径
create-react-app and url base path for the development server
在开发过程中,我想使用一个已经存在的测试服务器,这个服务器使用 apache,所以我基本上使用 mod_proxy 将它代理到我服务器的一个子目录,比方说 http://myserver/myreactapp/
问题是,我没有找到一种方法来告诉开发服务器 js 不应该在
<script type="text/javascript" src="/static/js/bundle.js"></script></body>
但在
<script type="text/javascript" src="/myreactapp/static/js/bundle.js"></script></body>
或更符合逻辑,在相对路径中。我为构建找到了这个选项,但没有为开发服务器找到。实现该目标的好方法是什么?
在开发过程中,我想使用一个已经存在的测试服务器,这个服务器使用 apache,所以我基本上使用 mod_proxy 将它代理到我服务器的一个子目录,比方说 http://myserver/myreactapp/ 问题是,我没有找到一种方法来告诉开发服务器 js 不应该在
<script type="text/javascript" src="/static/js/bundle.js"></script></body>
但在
<script type="text/javascript" src="/myreactapp/static/js/bundle.js"></script></body>
或更符合逻辑,在相对路径中。我为构建找到了这个选项,但没有为开发服务器找到。实现该目标的好方法是什么?