I’d like to implement Server Side Rendering in my app (and have it set up and working) but since the entire server restarts every time I change a UI file, I need to stick with Client Side Rendering most of the time and only switch to SSR for testing and building the app. Unfortunately, I’m struggling to find a good way to accomplish this.
Things I’ve tried so far:
- Creatied a
ui
folder, used.meteorignore
to avoid processing the files, and then symlinked the folder toclient/ui
andserver/ui
. When SSR is disabled, I’d remove theserver/ui
symlink. Unfortunately, meteor is aware of the symlink and won’t process the files. - Created a
ui/client
folder, used a script to rename the directory toui/shared
when SSR is enabled, and set up Babel path mapping soui/
refers to eitherui/client
orui/shared
depending on whether or not SSR is enabled. Unfortunately this runs into issues with stylesheets, which aren’t able to handle the path mapping.
If only there was a separate .meteorignore.server
for server-side files…
How do you handle SSR?