filesystem-routing

filesystem-routing scans route files into a router-neutral manifest. Vite delivers that manifest, while each router owns its conversion to router-specific definitions.


Package exports

filesystem-routing

filesystem-routing/tree

Exports the tree-building functions and type without loading the scanner.

filesystem-routing/vite

Exports fileRoutes(options?), its option type, and lower-level Vite adapter helpers.

filesystem-routing/api

Exports the API matcher and fetch-style middleware adapter.

filesystem-routing/types

Provides the ambient declaration for virtual:file-routes.

virtual:file-routes

The generated module exports the flat manifest as default and nested page entries as pageRoutes. See Manifest module.


Solid Router boundary

filesystem-routing does not export a Solid Router adapter. Import fileRoutes from @solidjs/router/fs to convert pageRoutes into Solid Router route definitions.

import { pageRoutes } from "virtual:file-routes";
import { createRouter } from "@solidjs/router";
import { fileRoutes } from "@solidjs/router/fs";
const Router = createRouter({ routes: fileRoutes(pageRoutes) });
Last updated: 8/11/26, 7:55 PMEdit this pageReport an issue with this page