Skip to content

Splitting loaders and default exports for a route for Vite #9323

Answered by sergiodxa
meza asked this question in Q&A
Discussion options

You must be logged in to vote

You can move them to a .server file and then re-export them. Let's say you have the route routes/something.tsx with a loader and component, you can rename it to routes/something/route.tsx then create a routes/something/loader.server.ts and in the route.tsx file add:

export { loader } from "./loader.server";

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@meza
Comment options

Answer selected by meza
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants