简体   繁体   English

在部署服务器上反应应用程序

[英]React app on deployment server

I have an Ubuntu VPS with Laravel v5.6 served with nginx, and I am trying to use React on the front-end. 我有一个带有Laravel v5.6的Ubuntu VPS和nginx一起使用,并且我试图在前端使用React。 I don't know if this is possible what I want to do is: 我不知道这是否可行:

  • use node and npm to build my front-end app locally, 使用node和npm在本地构建我的前端应用程序,
  • generate the CSS and JS files and upload those already generated files to my VPS server, 生成CSS和JS文件,并将那些已经生成的文件上传到我的VPS服务器,
  • the output should not change since as far as I know npm generates at JS and CSS files with your whole code in it 就我所知,输出不应该更改,因为据我所知,npm在包含您整个代码的JS和CSS文件中生成

Thanks for the help, and if there is any suggestion for a different approach just let me know. 感谢您的帮助,如果对其他方法有任何建议,请告诉我。

You should start to use a frontend bundling solution like webpack or parcel , they do exactly the same 您应该开始使用像webpackparcel这样的前端捆绑解决方案,它们的作用完全相同

If you generate your app with create-react-app it comes with webpack built-in 如果您使用create-react-app生成应用,则该应用会内置webpack

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

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