Custom Structure
Custom Project Structure
Use dex.config.ts to customize your folder structure.
Default Structure
web/
├─ pages/
├─ layouts/
└─ public/Custom Structure
Create dex.config.ts:
import { defineConfig } from 'dex/config'
export default defineConfig({
pagesDir: 'src/routes',
layoutsDir: 'src/layouts',
publicDir: 'static',
outDir: 'src/.generated',
})Now your structure becomes:
src/
├─ routes/ # Pages
├─ layouts/ # Layouts
└─ static/ # AssetsCLI Override
Override config on the command line:
bun run dev --pagesDir src/viewsProgrammatic Usage
import { generateFsRoutes } from '@dex/router'
await generateFsRoutes({
pagesDir: 'app/routes',
outTs: 'app/.generated/routes.ts',
})See Also
- Configuration — Config options
- Recipes Index — Other recipes