andreiduca / cra-ssr-code-splitting

Demo code for Server Side Rendering and Code Splitting in a create-react-app.
https://medium.com/bucharestjs/upgrading-a-create-react-app-project-to-a-ssr-code-splitting-setup-9da57df2040a
221 stars 70 forks source link

Question: application ssr with livereload? #4

Closed ilgianfra closed 6 years ago

ilgianfra commented 6 years ago

Hi!

I am trying to add SSR to CRA and i have seen (also from your repo) that is possible only with the build folder. So there is no way to have SSR with livereload if you don't create a custom webpack file for it.

What do you think?

andreiduca commented 6 years ago

Hot reload is managed the webpack dev server. For SSR, you run your own ExpressJS (node) server.

But why would you want to have them both at the same time anyway? SSR is last step for production, while development of the client React app can be done locally without SSR.

I have also answered to this issue here: https://medium.com/@andreiduca/short-answer-no-you-cant-have-ssr-and-hot-reloading-on-the-client-react-app-at-the-same-time-e469b9be833a

ilgianfra commented 6 years ago

Having SSR in development mode we found very useful, we had a custom configuration but now I wanted to try with CRA. Sometimes you have components or feature that are not included into the SSR flow, so noticing them during the development helps the productivity.

Thank you for your answer!