简体   繁体   中英

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. 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,
  • generate the CSS and JS files and upload those already generated files to my VPS server,
  • the output should not change since as far as I know npm generates at JS and CSS files with your whole code in it

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

If you generate your app with create-react-app it comes with webpack built-in

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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