Vite ignores your HTML entry keys and returns 404s on clean URLs. One plugin. Zero config. Dev routing and build output fixed together.
Works with any create-vite project — vanilla-ts, react-ts, or anything else.
--configLoader runner to resolve locally installed plugins correctly.vite build) is unaffected.
No separate processes, no port juggling, no proxy. The plugin hooks into Vite's existing lifecycle. ~100 lines of TypeScript.
src/pages/ and injects all HTML files as Rollup entry points. No manual listing needed./about to the correct HTML before Vite sees the request. HMR works untouched.dist/ at build time.I've been manually patching vite.config.js for two projects now. Dropped this in and it just worked.
The output path bug has been open in Vite for over a year. Glad someone fixed it at the plugin level.
Astro is overkill when you just want HTML, CSS, and TypeScript. This fills the exact gap.
Three hooks, ~100 lines of TypeScript. Read the source in five minutes. This is what a good plugin looks like.
Common questions about MPA routing in Vite and how this plugin addresses them.
Vite's dev server only routes to pages at their exact file paths. It doesn't know to map /about to src/pages/about/index.html. This plugin inserts a middleware that rewrites the URL before Vite handles the request.
Vite ignores entry key names for HTML files and uses the resolved file path instead. The plugin's generateBundle hook remaps paths to a clean flat structure.
No. The plugin globs src/pages/ recursively. Add a new folder with an index.html and it's automatically included in dev and build.
Yes. Single Vite instance, single HMR websocket. No per-page processes, no proxy, no coordination. It works exactly as in a standard Vite project.
Astro requires a new mental model. Parcel has the same dev routing problem. This plugin is just Vite — your existing config, your existing tooling, your existing knowledge.
Yes. Framework-agnostic. Works alongside @vitejs/plugin-react, @vitejs/plugin-vue, or any other Vite plugin.