vite-plugin-pages
vite-plugin-pages
File system based routing for Vue 3 / React / Solid applications using Vite
Reads your pages directory and generates a list of routes that you pass to your router.
| Framework | Router | Module id |
|---|---|---|
| Vue 3 | vue-router | ~pages |
| React | react-router (v6+) | ~react-pages |
| Solid | @solidjs/router | ~solid-pages |
Vue users should consider vue-router's built-in file-based routing instead. It provides similar features with deeper vue-router integration.
Quick Start
vite-plugin-pages v1 requires Node.js 22.12 or later, Vite 6 or later, and an ESM project or ESM-compatible Vite configuration. If you upgrade from v0.33, read the v1 migration guide.
Start with an existing Vue, React, or Solid Vite project. Install the plugin:
npm install -D vite-plugin-pages
Add it to your Vite configuration:
import Pages from 'vite-plugin-pages'
export default {
plugins: [
Pages(),
],
}
Create src/pages/index.vue, src/pages/index.tsx, or
src/pages/index.jsx. Then follow Getting Started
to connect the generated routes to your framework router.
Documentation
- Getting Started — install and set up each framework
- Configuration — every plugin option
- Base Path — deploy below the domain root
- File System Routing — routes, nesting, and routing styles
- Route Data —
<route>blocks and JSX comments - Custom Resolver — the
PageResolverAPI - Migrate to v1 — requirements and breaking changes
Sitemap generation
To generate a sitemap from the generated routes, use vite-plugin-pages-sitemap.
License
MIT License © 2021-PRESENT hannoeru
Related Packages
a vite plugin for automatically generating react or vue route files
A storybook decorator that allows you to use routing-aware components in your st...
Version History
| Version | Released | License |
|---|---|---|
| 0.33.3 | MIT | |
| 0.33.2 | MIT | |
| 0.33.1 | MIT | |
| 0.33.0 | MIT | |
| 0.32.5 | MIT | |
| 0.32.4 | MIT | |
| 0.32.3 | MIT | |
| 0.32.2 | MIT | |
| 0.32.1 | MIT | |
| 0.32.0 | MIT | |
| 0.31.0 | MIT | |
| 0.30.1 | MIT | |
| 0.30.0 | MIT | |
| 0.29.1 | MIT | |
| 0.29.0 | MIT | |
| 0.28.0 | MIT | |
| 0.27.1 | MIT | |
| 0.27.0 | MIT | |
| 0.26.0 | MIT | |
| 0.25.0 | MIT | |
| 0.24.3 | MIT | |
| 0.24.2 | MIT | |
| 0.24.1 | MIT | |
| 0.24.0 | MIT | |
| 0.23.0 | MIT | |
| 0.22.0 | MIT | |
| 0.21.4 | MIT | |
| 0.21.3 | MIT | |
| 0.21.2 | MIT | |
| 0.21.1 | MIT |
Showing the latest 30 of 120. See every release on npm
Pre-releases (20)
| Version | Released | License |
|---|---|---|
| 1.0.0-beta.3 | MIT | |
| 1.0.0-beta.2 | MIT | |
| 1.0.0-beta.1 | MIT | |
| 0.32.0-beta.0 | MIT | |
| 0.23.0-beta.3 | MIT | |
| 0.23.0-beta.2 | MIT | |
| 0.23.0-beta.1 | MIT | |
| 0.21.0-beta.2 | MIT | |
| 0.21.0-beta.1 | MIT | |
| 0.20.0-beta.3 | MIT | |
| 0.20.0-beta.2 | MIT | |
| 0.20.0-beta.1 | MIT | |
| 0.19.0-beta.8 | MIT | |
| 0.19.0-beta.7 | MIT | |
| 0.19.0-beta.6 | MIT | |
| 0.19.0-beta.4 | MIT | |
| 0.19.0-beta.3 | MIT | |
| 0.19.0-beta.2 | MIT | |
| 0.19.0-beta.1 | MIT | |
| 0.18.0-beta.1 | MIT |