We can use any routing library, such as Vue Router or React Router.
Shallow integration: (React/Vue Router supersedes vite-plugin-ssr
's built-in router.)
Deep integration: (React/Vue Router works hand-in-hand with vite-plugin-ssr
's built-in router.)
onBeforeRoute()
hook.That said, we recommend to only use vite-plugin-ssr
's built-in router: it's fundamentally simpler.
When doing SSR, there is no need for sophisticated routing libraries such as React Router or Vue Router.
Note that vite-plugin-ssr
's built-in router supports: