Replies: 1 comment
-
What happens if you use pnpm patch to remove the check from the remix vite plugin? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a project where we want to be able to ship an Electron-style client app and include in the install package a pre-built version of the web app content. We'll use this content if the user goes offline and first tries to launch the app while still offline, otherwise if they're online we'll refresh and fetch fresh from the internet, using service workers to cache everything for future offline use.
Given this requirement, it seems like we'd want to have an SPA build of our app for deployment in the client package, and a non-SPA build to deploy onto our web servers.
It's easy enough to toggle the Remix SSR flag in vite.config.js. However, if any of the routes include server-only exports like loader/action/headers, the SPA build fails. Wrapping the exports in conditions, e.g.
if (!__SPA__) { export const loader = async () => {} }
doesn't seem to be supported by the language.What should I do here to enable the same route files to be used in both environments?
Beta Was this translation helpful? Give feedback.
All reactions