⚠️
The vite-plugin-ssr project has been renamed Vike.
  • If you are already using vite-plugin-ssr, then migrate to Vike.
  • For new projects, don't use vite-plugin-ssr but use Vike instead.
It follows the same philosophy: Vike itself (without extensions) is unopinionated and lets you integrate tools with architectural freedom.

onBeforeRoute() hook

The onBeforeRoute() hook provides full control over routing.

It is usually used for internationalization.

We can also use it to implement a custom router.

⚠️
For use cases other than i18n, open a GitHub ticket or reach out on Discord: onBeforeRoute() is purposely limited but the limitations can be lifted in order to unlock new capabilities.

Example: