Is it worth implementing this approach and, if so, how to compile?

Tell me how to implement the final product in production to React or Vue leave a frontend server on a node or all to compile and move to nginx?
Tell me is it possible to compile React or VUE with the ranting and other add-ons in a single js file, which is connected as an ordinary static in the same nginx for example?
I just think if you run npm start and copy build.js who will be back in index.html and run it in the same nginx redirect routes index.html does not work for what I am planning?
Thank you!
March 20th 20 at 11:44
3 answers
March 20th 20 at 11:46
Solution
Usually all compiles to js and css.
nodejs for the website without PreRender in production is not needed.
March 20th 20 at 11:48
Solution
I just think if you run npm start and copy build.js who will be back in index.html and run it in the same nginx redirect routes index.html does not work for what I am planning?

You need to configure nginx to give the statics(fonts, images, styles, etc.) and for all non-static routes give the html with the application.
I mean, the question was that is it possible so?
And whether extra option when compiling then some) - Rachelle.Bode commented on March 20th 20 at 11:51
@heloise.Bins5, this is the whole point of the build - octavia_Schneider56 commented on March 20th 20 at 11:54
March 20th 20 at 11:50
Solution
Perhaps, but judging by the questions you still largely have to understand. Hardly someone will write here the config of nginx and webpage.
Google react/vue production build.
and likely more useful routing in Appah, history api and how to configure nginx to all the ranting in the application gave need js, but when referring to css/pictures - gave them.
there is still codesplitting to load only the necessary parts of the application but first do everything in one js file to understand how it all works.
Thank you! I just know how to set url in nginx, the only question was that possible or not? And if possible then how to compile well, and if you can explain how prerendering? And I as I now understand you can't do in single file and make a few somehow they will connect depending on the url in my SPA? - Rachelle.Bode commented on March 20th 20 at 11:53
@heloise.Bins5if you need prerendering something needed for this node, it is called server side rendering.

If you want nginx to just the app would then do a production build, put it in nginx and give it back as normal site - then js is doing everything in the browser.

you can't do in single file and make a few somehow they will connect depending on the url in my SPA?

can. I have already written that Google in the last report. - Iliana_Strosi commented on March 20th 20 at 11:56

Find more questions by tags NginxNode.jsReactVue.js