# Vite Plugin: File-based Routing The `sigproRouter` plugin for Vite automates route generation by scanning your `pages` directory. It creates a **virtual module** that you can import directly into your code, eliminating the need to maintain a manual routes array. ## 1. Project Structure To use the plugin, organize your files within the `src/pages` directory. The folder hierarchy directly determines your application's URL structure. SigPro uses brackets `[param]` for dynamic segments.
my-sigpro-app/
├── src/
│ ├── pages/
│ │ ├── index.js → #/
│ │ ├── about.js → #/about
│ │ ├── users/
│ │ │ └── [id].js → #/users/:id
│ │ └── blog/
│ │ ├── index.js → #/blog
│ │ └── [slug].js → #/blog/:slug
│ ├── App.js (Main Layout)
│ └── main.js (Entry Point)
├── vite.config.js
└── package.json
| File Path | Generated Path | Description |
|---|---|---|
index.js |
/ | The application root. |
about.js |
/about | A static page. |
[id].js |
/:id | Dynamic parameter (passed to the component). |
blog/index.js |
/blog | Folder index page. |
_utils.js |
Ignored | Files starting with _ are excluded from routing. |