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
.meteorignoreto avoid processing the files, and then symlinked the folder to
server/ui. When SSR is disabled, I’d remove the
server/uisymlink. Unfortunately, meteor is aware of the symlink and won’t process the files.
- Created a
ui/clientfolder, used a script to rename the directory to
ui/sharedwhen SSR is enabled, and set up Babel path mapping so
ui/refers to either
ui/shareddepending 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?