A Vite DevTools plugin that scans runtime UI churn and highlights hot DOM areas, inspired by react-scan.
Vite Scan action button and settings panel to Vite DevTools.localStorage. No need to re-enable after every reload.pnpm add -D vite-scan @vitejs/devtools
# or
npm i -D vite-scan @vitejs/devtools
# or
yarn add -D vite-scan @vitejs/devtools
import { defineConfig } from 'vite'
import { DevTools } from '@vitejs/devtools'
import viteScan from 'vite-scan'
export default defineConfig({
plugins: [
DevTools(),
viteScan(),
],
})
Open Vite DevTools, click the Vite Scan action to start scanning, or open the Vite Scan dock page to tweak settings.
Settings are auto-applied at runtime from the dock page (debounced), so you no longer need to edit vite.config.ts for every tweak.
interface ViteScanPluginOptions {
inactiveIcon?: string // default: 'ph:scan'
activeIcon?: string // default: 'ph:scan-duotone'
}
The following settings can be configured live from the DevTools settings panel:
| Setting | Type | Default | Description |
|---|---|---|---|
enabled |
boolean |
true |
Enables or disables scan execution |
highlightColor |
string |
#A78BFA |
Outline color for highlighted mutations |
glowColor |
string |
rgba(167, 139, 250, 0.50) |
Glow color for the pulse animation |
outlineWidthPx |
number |
2 |
Outline width in pixels |
outlineOffsetPx |
number |
1 |
Outline offset in pixels |
pulseDurationMs |
number |
420 |
Pulse animation duration in milliseconds |
pulseSpreadPx |
number |
10 |
Pulse spread in pixels |
When a scan is active, the dock button switches icon, title, and shows an ON badge.
From this directory:
pnpm i
pnpm build
pnpm play:dev
To launch a single hub page with links to all framework demos:
pnpm play:examples
Additional working examples are available for each framework:
pnpm play:vanilla
pnpm play:react
pnpm play:vue
pnpm play:svelte
Each example opens a small high-churn UI so you can run Vite Scan from DevTools and compare how React, Vue, Svelte, and vanilla DOM updates show up.
MIT License. See LICENSE for details.