-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade to vite #624
upgrade to vite #624
Conversation
// This is for server-side utilities you want to colocate next to | ||
// your routes without making an additional directory. | ||
// If you need a route that includes "server" or "client" in the | ||
// filename, use the escape brackets like: my-route.[server].tsx | ||
'**/*.server.*', | ||
'**/*.client.*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably the most significant change. It's the primary reason source code was changed. Remix with vite is more strict about your code that can end up in the client not using anything that's server-only so if you export anything other than the standard exports in a route that uses server-only code it'll error.
export function loader({ request }: LoaderFunctionArgs) { | ||
return generateSitemap(request, routes, { | ||
export async function loader({ request, context }: LoaderFunctionArgs) { | ||
const serverBuild = (await context.serverBuild) as ServerBuild |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was another interesting change because importing @remix-run/dev/server-build
is not allowed in vite.
serverBuild: getBuild(), | ||
}), | ||
mode: MODE, | ||
// @sentry/remix needs to be updated to handle the function signature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this is great :)
https://remix.run/blog/remix-vite-stable