Getting Started
Current status
WARNING
Routeflux is under heavy development. Do not use it in production yet.
Routeflux finds routes and writes outputs automatically.
Install the Vite plugin
Add the Routeflux Vite plugin to your app workspace:
bash
pnpm add -D @routeflux/vite-pluginThen register it in your Vite config:
ts
import { defineConfig } from "vite";
import { crawlerPlugin } from "@routeflux/vite-plugin";
export default defineConfig({
plugins: [
crawlerPlugin({
baseUrl: "https://example.com",
output: ["routes.json", "sitemap.xml"],
}),
],
});What it does
vite devstarts a crawl when the server is readyvite buildcrawls after files are written- adapters add static routes before crawling
- matching static and runtime routes become
hybrid
Output location
routes.jsonandsitemap.xmlare written into Vite's resolvedbuild.outDir- if
outputis omitted, Routeflux writesroutes.json sitemap.xmlrequires a validbaseUrlorserver.origin
Local development
bash
vp install
vp run docs#devEdit files in apps/docs/src.
Workspace commands
bash
vp check
vp run check -r
vp run test -r
vp run build -rIn short
- detect routes
- crawl the app
- merge results
- write outputs