vite-plugin-restart weekly downloads statistics
By antfu (15 listings) · npm · Vite plugins
Custom files/globs to restart Vite server
vite-plugin-restart has 58,121 recorded weekly downloads on npm, an increase of 14.8% over the past 30 days, ranking #745 of 3,247 tracked listings.
About vite-plugin-restart
Usage
Install
npm i vite-plugin-restart -D # yarn add vite-plugin-restart -D
Add it to vite.config.js
// vite.config.js
import ViteRestart from 'vite-plugin-restart'
export default {
plugins: [
ViteRestart({
restart: [
'my.config.[jt]s',
]
})
],
}
Changes to my.config.js or my.config.ts will now restart the server automatically.
Options
export interface VitePluginRestartOptions {
/**
* Enable glob support for watcher (it's disabled by Vite, but add this plugin will turn it on by default)
* @default true
*/
glob?: boolean
/**
* Delay in ms before restarting the server
* @default 500
*/
delay?: number
/**
* Array of files to watch, changes to those file will trigger a server restart
*/
restart?: string | string[]
/**
* Array of files to watch, changes to those file will trigger a client full page reload
*/
reload?: string | string[]
/**
* Enable content-based change detection to prevent unnecessary restarts
* when file metadata changes but content remains the same
* @default true
*/
contentCheck?: boolean
}
Content-Based Change Detection
By default, the plugin now uses content-based change detection (contentCheck: true). This prevents infinite restart loops when watching auto-generated files that may be rewritten with the same content.
For example, when watching .eslintrc-auto-import.json:
export default {
plugins: [
ViteRestart({
restart: [
'.eslintrc-auto-import.json',
],
// Content check is enabled by default
// Only restarts if file content actually changes
contentCheck: true,
})
],
}
The plugin calculates a SHA-256 hash of the file content and only triggers a restart if the hash changes. This solves the problem of:
- Auto-generated files being rewritten during the build process
- File modification timestamps changing without actual content changes
- Infinite restart loops caused by files being regenerated on every server restart
You can disable this feature if needed:
export default {
plugins: [
ViteRestart({
restart: ['my.config.js'],
contentCheck: false, // Disable content-based detection
})
],
}
Motivation
Byebye nodemon -w my.config.js -x 'vite'
License
MIT License © 2021 Anthony Fu
Description from the npm listing.
- vite-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Vite plugins plugins
All 20 vite-plugin-restart alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/vite-plugin-restart. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.