Automatically reload the page when watched files change during development with Vite.
// vite.config.js
import pageReload from 'vite-plugin-page-reload'
export default {
plugins: [
pageReload('/tmp/theme.update')
]
}
Type: string | string[]
File paths (or globs) to watch for changes. The page will reload when any of these files change.
Type: boolean
Default: true
Reload the page regardless of the modified file.
Type: number
Default: 25
Milliseconds to wait before reloading after a change.
Type: boolean
Default: true
Log file change-triggered reloads.
Type: string
Default: process.cwd()
Resolve paths against this directory.
This plugin is based on the ideas from the following projects and extends their functionality with the addition of a debounce function: