Because I have a bit of a misunderstanding of the core principles of server rendering, there is no code.
I have:
Nest.js is configured with Handlebars. It is built using TypeScript out of the box. I don't use webpack here. I also created a separate folder that contains the client portion of my application. React, webpack, etc. are already configured and working fine.
I need to create a server render. For this I use ReactDOMServer. Everything works fine except when encountering SVG components and CSS modules.
This is my question - how to deal with it? What is the correct approach? Should I copy the webpack configuration on the server side (referring to resources), or is there a way to make it work with TypeScript (npm run build)?
thank you for your help!
You need to provide static resource files https://docs.nestjs.com/recipes/serve-static
You need to install @nestjs/serve-static