Do full page reloads when the source code changes, including any non-dev dependencies.
Reloads are debounced so that changes to multiple watched files will cause fewer reloads.
Example: vite.config.ts
import { defineConfig } from 'vite';
import refresh from 'vite-plugin-refresh';
export default defineConfig({
plugins: [refresh()],
});
include?: string[]
: Include (additional) dependencies in the watch list.exclude?: string[]
: Exclude dependencies from the watch list.delay?: number
: Delay page reloads by a number of milliseconds. Defaults to1000
.log?: boolean
: Log changed files and page reloads to the console. Defaults tofalse
.
Example:
refresh({
include: ['package-a'],
exclude: ['package-b'],
delay: 3000,
log: true,
});
When continuously building a monorepo, it is recommended that you NOT delete build output on each rebuild. For example, when using Vite in "Library Mode", set the build.emptyOutDir
option to false
. When using the Typescript compiler in watch mode, don't set the --clean
flag.