-
Hey, I'm in the process of migrating over to Vite and one of the problems I'm facing is that some of my loaders are most definitely server only (as intended by Remix) but now Vite is complaining. Can I split the loaders out to a different .server file? If so, how would I configure the routes? (I use custom config for the routes) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can move them to a export { loader } from "./loader.server"; |
Beta Was this translation helpful? Give feedback.
You can move them to a
.server
file and then re-export them. Let's say you have the routeroutes/something.tsx
with a loader and component, you can rename it toroutes/something/route.tsx
then create aroutes/something/loader.server.ts
and in the route.tsx file add: