SvelteKitDevServer

The SvelteKitDevServer extends ViteDevServer with SvelteKit’s file-based routing conventions.

Constructor

import { SvelteKitDevServer } from "@run0/jiki";

const server = new SvelteKitDevServer(vfs, {
  port: 5173,
  root: "/",
  routesDir: "/src/routes",
});

Options

Inherits all ViteDevServer options plus:

OptionTypeDefaultDescription
routesDirstring"/src/routes"Routes directory

Routing conventions

FilePurpose
+page.sveltePage component
+layout.svelteLayout wrapper (inherited by child routes)
+server.tsAPI endpoint
+error.svelteError page

Route discovery

const routes = server.discoverRoutes();
// [{ route: '/', pagePath: '/src/routes/+page.svelte', ... }]