Registry / web-framework / vite-plugin-full-reload

vite-plugin-full-reload

JSON →
library1.2.0jsnpmunverified

A Vite plugin that triggers a full page reload when specified files (e.g., server-rendered templates, routes) are modified. Current stable version is 1.2.0. Released as needed, with ~1 year between minor versions. Unlike HMR-based solutions, this plugin forces a complete browser refresh, making it ideal for frameworks like Ruby on Rails where HMR is not available for server-rendered assets. It uses picomatch for glob patterns, supports configurable root directory, delay, and 'always' option. The plugin is lightweight and does not create an extra chokidar watcher, relying on Vite's built-in file watching.

npm install vite-plugin-full-reload
INSTALL
IMPORT
SIG · VITE-PLUGIN-FULL-R
V
vite-plugin-full-reload
web-frameworkjavascriptv1.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import FullReload from 'vite-plugin-full-reload'
const FullReload = require('vite-plugin-full-reload')
Default import; CommonJS require works but TypeScript type inference may be limited. ESM-only types are provided.
FullReload
import FullReload from 'vite-plugin-full-reload'
import { FullReload } from 'vite-plugin-full-reload'
The package exports a default function, not a named export Named import like 'import { FullReload }' is incorrect.
VitePluginFullReload
import FullReload from 'vite-plugin-full-reload'
import VitePluginFullReload from 'vite-plugin-full-reload'
The default export is named 'FullReload' in documentation; using any other import name is fine but the actual symbol is default.

Shows how to add vite-plugin-full-reload to a Vite config to trigger full page reload on changes to server-rendered templates.

import { defineConfig } from 'vite' import FullReload from 'vite-plugin-full-reload' export default defineConfig({ plugins: [ // Reload the page when routes.rb or any view template changes FullReload(['config/routes.rb', 'app/views/**/*'], { root: process.cwd(), // optional, default delay: 0, // optional, default always: true // optional, default }) ] })
Debug
Known issues
gotchaThe plugin triggers a full page reload, not HMR. If you expect HMR-like partial updates, this will cause complete page refresh.
fix
Use HMR plugins for JS/TS changes; this plugin is intended for non-imported files (e.g., server-side templates).
affects: >=1.0.0
gotchaThe 'always' option defaults to true, meaning a reload is triggered even if the changed file is not currently displayed in the browser. Set always: false to limit reloads to active tabs.
fix
Explicitly set `always: false` if you want reload only when the file is visible in the browser.
affects: >=1.0.0
deprecatedNo deprecations known. Plugin is actively maintained.
Errors
Common errors & fixes
Error: Cannot find module 'vite-plugin-full-reload'
Package not installed or missing in node_modules.
fix
Run `npm install vite-plugin-full-reload --save-dev`
TypeError: FullReload is not a function
Wrong import style: using named import instead of default import.
fix
Use `import FullReload from 'vite-plugin-full-reload'` instead of `import { FullReload } from ...`
TypeError: Cannot read properties of undefined (reading 'map')
The first argument to FullReload must be an array of strings (glob patterns). Passing a string or undefined causes this error.
fix
Ensure you pass an array: `FullReload(['config/routes.rb'])`
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
picomatchrequiredPattern matching for glob expressions
viteoptionalVite plugin, expected as peer dependency
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
vite-plugin-full-reload — npm install vite-plugin-full-reload · libregistry