vite-plugin-pages

File system base vue-router plugin for Vite
3,111,719 2,076
Install
npm install vite-plugin-pages
Latest Version:0.33.3
Vue:3
License:MIT
Last Updated:Oct 19, 2026
Links: GitHub  ·  npm
Maintainer: antfu

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.

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

Sitemap generation

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

License

MIT License © 2021-PRESENT hannoeru

Related Packages

@tachibana-shin/vite-plugin-pages

File system base vue-router plugin for Vite

2,482 2,076
vite-plugin-pages2

File system base vue-router plugin for Vite

2,171 1
@onoxm/vite-plugin-auto-router

a vite plugin for automatically generating react or vue route files

12,808
storybook-router

A storybook decorator that allows you to use routing-aware components in your st...

26,590 257
vite-plugin-remix-router

Remix style file-system routing for React and Vite

4,716 25

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
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