create-vanjs
Version:
🍦 Quick tool for scaffolding your first VanJS project
20 lines (16 loc) • 326 B
text/typescript
import { lazy, Route } from "@vanjs/router";
import { Home, route } from "./pages/home";
// Register routes
Route({
...route,
path: "/",
component: Home,
});
Route({
path: "/about",
component: lazy(() => import("./pages/about")),
});
Route({
path: "*",
component: lazy(() => import("./pages/not-found")),
});