hannoeru/vite-plugin-pages

File system based route generator for ⚡️Vite

TypeScript

2,076

1,114 commits

updated Oct 10, 2026

See the code

README

vite-plugin-pages

npm version monthly downloads types license

Open in Visual Studio Code

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.

FrameworkRouterModule id
Vue 3vue-router~pages
Reactreact-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

Sitemap generation

To generate a sitemap from the generated routes, use vite-plugin-pages-sitemap.

License

MIT License © 2021-PRESENT hannoeru

Project health

Overall

5.3/10

Maintained

10/10

Code review

5/10
OpenSSF Scorecard

Latest release

0.33.3 · Feb 2, 2026

Releases this year

2

Significant stargazers

Gajus Kuizinas

2,635 followers · starred May 2022

Thorsten Lünborg

2,581 followers · starred May 2021

zhiyuanzmj

159 followers · starred Nov 2022

Tsuki

871 followers · starred Jul 2022

hannoeru/vite-plugin-pages

File system based route generator for ⚡️Vite

TypeScript

2,076

1,114 commits

updated Oct 10, 2026

See the code

README

vite-plugin-pages

npm version monthly downloads types license

Open in Visual Studio Code

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.

FrameworkRouterModule id
Vue 3vue-router~pages
Reactreact-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

Sitemap generation

To generate a sitemap from the generated routes, use vite-plugin-pages-sitemap.

License

MIT License © 2021-PRESENT hannoeru

Project health

Overall

5.3/10

Maintained

10/10

Code review

5/10
OpenSSF Scorecard

Latest release

0.33.3 · Feb 2, 2026

Releases this year

2

Significant stargazers

Gajus Kuizinas

2,635 followers · starred May 2022

Thorsten Lünborg

2,581 followers · starred May 2021

zhiyuanzmj

159 followers · starred Nov 2022

Tsuki

871 followers · starred Jul 2022