Skip to content

Have vite-ssr not render certain components/paths #94

Answered by frandiox
LagnerKol asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! Right now, we don't have any feature to choose SSR vs SPA on a route basis. There are some alternatives:

  • Use <ClientOnly> component around whatever you don't need in SSR.
  • In your production server, before passing the route to vite-ssr, check the URL and just return index.html content if you don't want to do SSR. There's more info in this issue. If you want the same behavior during development, try providing your own dev server using vite-ssr in middleware mode.

Hope that helps!

Replies: 1 comment 1 reply

Comment options

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

Answer selected by LagnerKol
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