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
uifolder, used.meteorignoreto avoid processing the files, and then symlinked the folder toclient/uiandserver/ui. When SSR is disabled, I’d remove theserver/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 toui/sharedwhen SSR is enabled, and set up Babel path mapping soui/refers to eitherui/clientorui/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?