Vite plugin for HTML template injection and multi-page application (MPA) support. Current stable version 1.0.33, with ongoing active development. Provides HTML minification, EJS template data injection, custom entry/template, and build output configuration including HTML hash, directory restructuring, and prefix replacement. Differentiates from alternatives like vite-plugin-html by actively supporting Vite 5 and offering built-in MPA features with a pages configuration system, while the older plugin is unmaintained. Ships TypeScript types.
npm install vite-plugin-html-template-mpaVerified import paths — ran on the pinned version, not inferred.
Configures Vite for MPA with custom pages, HTML minification, and build output restructuring.
Refer to the updated documentation; the default `pagesDir` changed to `src/views`.
Set `pagesDir` to your actual pages directory, e.g., `pagesDir: 'src/pages'`.
Use `urlParams` for adding parameters to the generated index page links, not individual page templates.
Migrate from `vite-plugin-html` to this plugin for Vite 5 compatibility.
Run `pnpm add vite-plugin-html-template-mpa` and use default import as shown in quickstart.
Use `import htmlTemplate from 'vite-plugin-html-template-mpa'`.
Add `pagesDir` to the plugin options, e.g., `pagesDir: 'src/views'`.
No dependency data recorded yet.