vite-plugin-live-reload is a simple Vite plugin that triggers a full page reload when watched files change. Current stable version is 3.1.0, with a release cadence of occasional minor/patch updates. It uses chokidar under the hood and supports glob patterns, multiple paths, a custom root, and an alwaysReload option. Unlike Vite's built-in HMR, this plugin targets backend-driven projects (e.g., Kirby CMS, PHP, Rails) where file changes on the server side need to trigger a browser reload. It has zero runtime dependencies beyond Vite (peer dep vite ^4 || ^5 || ^6 || ^7 || ^8) and ships TypeScript definitions.
npm install vite-plugin-live-reloadVerified import paths — ran on the pinned version, not inferred.
Configures Vite to reload the browser when PHP or Twig files change using glob patterns and alwaysReload option.
Upgrade to Vite >=3 or stick with v2.x line (v2.1.0).
Use the 'root' option to set a custom root directory: liveReload('path', { root: process.cwd() }).Use only for backend file watchers; do not expect HMR-like behavior.
Use with caution; only enable when needed for specific workflows.
Use default import: import liveReload from 'vite-plugin-live-reload' (or named export still works).
Pass at least one glob pattern string or array: liveReload('**/*.php').Run npm install vite --save-dev.
Use import liveReload from 'vite-plugin-live-reload' (default) or import { viteLiveReload } from 'vite-plugin-live-reload' (named).No action needed; it's normal behavior.