Server side rendering and codesplitting using create react app and loadable components

1k Views Asked by At

Anyone have any experience converting a react app created with create-react-app to using server side rendering and code splitting via loadable-components? I know this is a general question, but mostly looking for general guidance or any major red flags for this approach. I'd like to keep the nice things you get out of box with create-react-app - especially the live reload dev environment - while adding in optimizations using SSR and code splitting. I was able to mostly get this working using express backend and handlebars templating, but I'm facing many challenges getting code splitting working correctly with this setup. Any hints / stories are appreciated!

1

There are 1 best solutions below

0
On

There is craco "an easy and comprehensible configuration layer for create-react-app".

Webpack custom configurations go into craco.config.js, inside root folder.

SSR is possible, you can check two related questions that might help you with your case:
Code splitting loads all chunk files on chrome but load them separately in firefox
Loadable Components SSR - chunkNames in Server Stats file different from Client stats file