简体   繁体   English

如何将 react 项目添加到现有的 jquery/vanilla js 项目中?

[英]How can I add react project to an existing jquery/vanilla js project?

I have a main/hero website built with html+jquery and dashboard with react .我有一个使用html+jquery带有 react 的仪表板构建的主/英雄网站 Currently dashboard serves from different subdomain (dashboard.example.com) and website from (example.com) .当前仪表板从不同的子域(dashboard.example.com)和来自(example.com)网站提供服务。 I would like them to be in same folder such that website would still be (example.com) but dashboard would be (example.com/dashboard) .我希望它们在同一个文件夹中,这样网站仍然是(example.com)但仪表板将是(example.com/dashboard) Can someone help me how I can achieve this?有人可以帮助我如何实现这一目标吗?

maybe you can try this trick:也许你可以试试这个技巧:

  • create new child folder called dashboard inside your public folder, and move index.html with build file react dashboard, inside the dashboard public folder.在您的公用文件夹中创建名为dashboard 的新子文件夹,并在仪表板公用文件夹中移动带有构建文件反应仪表板的 index.html。
  • and then load react js build bundle from the move index.html inside dashboard folder.然后从仪表板文件夹内的移动 index.html 加载 react js build bundle。

they will be called into the new folder dashboard in example.com/dashboard它们将被调用到 example.com/dashboard 中的新文件夹仪表板中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM