Registry / devops / vite-plugin-page-reload

vite-plugin-page-reload

JSON →
library0.2.3jsnpmunverified

Automatically reload the page when watched files change during development with Vite. Current stable version is 0.2.3. Release cadence is irregular, with updates primarily to support new Vite major versions (v5, v6, v7, v8). Key differentiator from alternatives (like vite-plugin-live-reload or vite-plugin-full-reload) is the inclusion of a debounce function and a configurable delay. Ships TypeScript types. Commonly used in Shopify theme development setups.

npm install vite-plugin-page-reload
INSTALL
IMPORT
SIG · VITE-PLUGIN-PAGE-R
V
vite-plugin-page-reload
devopsjavascriptv0.2.3
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.

pageReload
import pageReload from 'vite-plugin-page-reload'
const pageReload = require('vite-plugin-page-reload')
Default export; ESM-only since v0.2.0. CommonJS require will fail.
PageReloadOptions
import type { PageReloadOptions } from 'vite-plugin-page-reload'
import { PageReloadOptions } from 'vite-plugin-page-reload'
Type export for TypeScript users; do not use value import.
PageReloadPlugin
import type { PageReloadPlugin } from 'vite-plugin-page-reload'
import { PageReloadPlugin } from 'vite-plugin-page-reload'
Type export for the plugin type; value import will be undefined.

Configure Vite to reload the browser when /tmp/theme.update is modified, with a 50ms delay and logging enabled.

// vite.config.js import { defineConfig } from 'vite' import pageReload from 'vite-plugin-page-reload' export default defineConfig({ plugins: [ pageReload('/tmp/theme.update', { always: true, delay: 50, log: true }) ] })
Debug
Known issues
breakingDefault export changed from object to function in v0.2.0
fix
Update import from `import { pageReload }` to `import pageReload`
affects: <0.2.0
breakingVite 4 support dropped in v0.2.2
fix
Use v0.2.1 if you need Vite 4 support
affects: >=0.2.2
gotchaPaths are relative to root option, default process.cwd(). Glob patterns supported but not documented.
fix
Use absolute paths or ensure root matches your project structure
affects: >=0.1.0
gotchaSetting `always: false` may cause inconsistent reloads when multiple files change simultaneously
fix
Keep `always: true` (default) to ensure reload on any watched file change
affects: >=0.1.0
deprecatedOptions `watchOptions` and `ignore` have been removed in v0.2.0. Use `always` and `paths` instead.
fix
Remove `watchOptions` and `ignore`; configure via `always` and `paths`
affects: >=0.2.0
Errors
Common errors & fixes
Cannot find module 'vite-plugin-page-reload' or its corresponding type declarations.
Package not installed or TypeScript cannot resolve types.
fix
Run `npm install -D vite-plugin-page-reload` and ensure tsconfig includes node_modules resolution.
ERR_REQUIRE_ESM: require() of ES Module ... not supported.
Using CommonJS require() to import an ESM-only package.
fix
Change to `import` statement or use dynamic import(). Ensure your project is ESM by adding `"type": "module"` to package.json.
TypeError: pageReload is not a function
Using named import instead of default import.
fix
Change `import { pageReload }` to `import pageReload`.
The requested module 'vite-plugin-page-reload' does not provide an export named 'PageReloadOptions'
Importing a type as a value.
fix
Use `import type { PageReloadOptions } from 'vite-plugin-page-reload'`
Upgrade
Version history
0.2.3latest on npm
Audit
Dependencies
viterequiredpeer dependency; plugin requires Vite as the dev server
Agent activity
4 hits · last 30 days
node
4
Resources
vite-plugin-page-reload — npm install vite-plugin-page-reload · libregistry