RemixDevServer

The RemixDevServer extends ViteDevServer with Remix’s flat file routing conventions.

Constructor

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

const server = new RemixDevServer(vfs, {
  port: 3000,
  root: "/",
  routesDir: "/app/routes",
  appDir: "/app",
});

Options

Inherits all ViteDevServer options plus:

OptionTypeDefaultDescription
routesDirstring"/app/routes"Routes directory
appDirstring"/app"App directory

Routing conventions

Remix uses flat file routing with dot-delimited nesting:

FileRoute
routes/_index.tsx/
routes/about.tsx/about
routes/dashboard.settings.tsx/dashboard/settings
routes/dashboard._index.tsx/dashboard

Route discovery

const routes = server.discoverRoutes();
// [{ route: '/', filePath: '/app/routes/_index.tsx', isLayout: false }]