Skip to main content
vite.config.ts
Every path below is optional to pass in. Defaults assume srcDir: "src".

Directories and files

src/worker.ts is optional. Node apps do not need it. If the file is missing, the plugin also looks at src/config/worker.ts.

Runtime

You do not add @vitejs/plugin-react yourself — betterRouter() already includes it. Pass react: { babel: ... } if you need to. Vite’s envPrefix is set to PUBLIC_ so only import.meta.env.PUBLIC_* is exposed to client bundles. See Environment and secrets.

Markdown

.md / .mdx files in routesDir are pages. See Markdown pages.