Skip to content

How safe is it to use Vite + SSR in production? #61

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

You must be logged in to vote

@tonycassara Hello! There's a discussion about this here: vitejs/vite#4230

This package (vite-ssr) is just using Vite internally to do the SSR for you without big complications, but of course it's subject to Vite's "experimental" status.

I know other people that have used this with React + Styled Components, and I can tell you the following:

  • React itself is not very SSR-friendly, so it is possible you might find issues with advanced stuff (but I guess this is true regardless if you use Vite or not).
  • Styled Components need extra setup on your end because they require using Babel (and Vite does not use Babel by default) for some sort of SSR style hashing. I think you can use vite-plugin-babel

Replies: 1 comment 1 reply

Comment options

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

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