{"id":22670,"library":"vite-plugin-full-reload","title":"vite-plugin-full-reload","description":"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.","status":"active","version":"1.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/ElMassimo/vite-plugin-full-reload","tags":["javascript","vite","plugin","vite-plugin","vitejs","full","reload","typescript"],"install":[{"cmd":"npm install vite-plugin-full-reload","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-full-reload","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-full-reload","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Pattern matching for glob expressions","package":"picomatch","optional":false},{"reason":"Vite plugin, expected as peer dependency","package":"vite","optional":true}],"imports":[{"note":"Default import; CommonJS require works but TypeScript type inference may be limited. ESM-only types are provided.","wrong":"const FullReload = require('vite-plugin-full-reload')","symbol":"default","correct":"import FullReload from 'vite-plugin-full-reload'"},{"note":"The package exports a default function, not a named export Named import like 'import { FullReload }' is incorrect.","wrong":"import { FullReload } from 'vite-plugin-full-reload'","symbol":"FullReload","correct":"import FullReload from 'vite-plugin-full-reload'"},{"note":"The default export is named 'FullReload' in documentation; using any other import name is fine but the actual symbol is default.","wrong":"import VitePluginFullReload from 'vite-plugin-full-reload'","symbol":"VitePluginFullReload","correct":"import FullReload from 'vite-plugin-full-reload'"}],"quickstart":{"code":"import { defineConfig } from 'vite'\nimport FullReload from 'vite-plugin-full-reload'\n\nexport default defineConfig({\n  plugins: [\n    // Reload the page when routes.rb or any view template changes\n    FullReload(['config/routes.rb', 'app/views/**/*'], {\n      root: process.cwd(), // optional, default\n      delay: 0,            // optional, default\n      always: true         // optional, default\n    })\n  ]\n})","lang":"typescript","description":"Shows how to add vite-plugin-full-reload to a Vite config to trigger full page reload on changes to server-rendered templates."},"warnings":[{"fix":"Use HMR plugins for JS/TS changes; this plugin is intended for non-imported files (e.g., server-side templates).","message":"The plugin triggers a full page reload, not HMR. If you expect HMR-like partial updates, this will cause complete page refresh.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Explicitly set `always: false` if you want reload only when the file is visible in the browser.","message":"The '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.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"","message":"No deprecations known. Plugin is actively maintained.","severity":"deprecated","affected_versions":""}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `npm install vite-plugin-full-reload --save-dev`","cause":"Package not installed or missing in node_modules.","error":"Error: Cannot find module 'vite-plugin-full-reload'"},{"fix":"Use `import FullReload from 'vite-plugin-full-reload'` instead of `import { FullReload } from ...`","cause":"Wrong import style: using named import instead of default import.","error":"TypeError: FullReload is not a function"},{"fix":"Ensure you pass an array: `FullReload(['config/routes.rb'])`","cause":"The first argument to FullReload must be an array of strings (glob patterns). Passing a string or undefined causes this error.","error":"TypeError: Cannot read properties of undefined (reading 'map')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}