⚠️
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.

filesystemRoutingRoot

The export { filesystemRoutingRoot } of _default.page.route.js allows us to change the URL root of Filesystem Routing.

Don't use filesystemRoutingRoot to change the base URL, see Routing > Base URL instead.

filesystemRoutingRoot is usually used for domain-driven file structure.

Example

// /marketing/_default.page.route.js

// We route our marketing pages to `/*` instead of `/marketing/*`
export const filesystemRoutingRoot = '/'
/marketing/_default.page.route.js
/marketing/pages/index/index.page.js
/marketing/pages/about/index.page.js
/marketing/pages/jobs/index.page.js

Result:

PROJECT FILES                                    URL
/marketing/pages/index/index.page.js             /
/marketing/pages/about/index.page.js             /about
/marketing/pages/jobs/index.page.js              /jobs