GitShow/antfu/vite-plugin-restart
antfu

vite-plugin-restart

Custom files/globs to restart Vite server

by antfu
auto-restartvitevite-plugin
Star on GitHubForknpm

TypeScript

211 stars15 forks10 contributorsQuiet · 8mo agoSince 2021v2.0.0MIT

Meet the team

See all 10 on GitHub →
antfu
antfu26 contributions
alesvaupotic
alesvaupotic1 contribution
khalwat
khalwat1 contribution
cpojer
cpojer1 contribution
DanielFallon
DanielFallon1 contribution
gTutini
gTutini1 contribution
xiaoxiaohuayu
xiaoxiaohuayu1 contribution
BiscuiTech
BiscuiTech1 contribution

Languages

View on GitHub →
TypeScript98.4%
JavaScript1.6%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

5 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template✓PR Template

Recent PRs & issues

Quiet · 1 in progress · Last activity 8mo ago
See all on GitHub →
rjaros
Support Vite v8OpenIssue

Any chance to support Vite v8 beta?

rjaros · 6d ago
FlorianV85
feat: add support for vite 8OpenPR

Please be aware that vibe-coding contributions are 🚫 STRICTLY PROHIBITED. We are humans behind these open source projects, trying hard to maintain good quality and a healthy community. Not only do vibe-coding contributions pollute the code, but they also drain A LOT of unnecessary energy and time from maintainers and toxify the community and collaboration. All vibe-coded, AI-generated PRs will be rejected and closed without further notice. In severe cases, your account might be banned organization-wide and reported to GitHub. PLEASE SHOW SOME RESPECT and do not do so. Before submitting the PR, please make sure you do the following: Read the Contributing Guide. Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate. Provide a description in this PR that addresses what the PR is solving and WHY**, or reference the issue that it solves (e.g. ). Ideally, include relevant tests that fail without this PR but pass with it. [X] Linked Issues fixes #31 Additional context

FlorianV85 · 3mo ago
nqdy666
请求增加文件内容检测机制以避免不必要的 Vite 服务器重启OpenIssue

Clear and concise description of the problem 目前,当监听 .eslintrc-auto-import.json 文件变化时,即使文件内容没有实际改变,也会触发 Vite 开发服务器重启。这导致了无限重启循环的问题,因为: 1. .eslintrc-auto-import.json 是一个自动生成的文件,在项目构建过程中可能会频繁被写入。 2. 当前的监听机制仅基于文件修改时间或文件系统事件,而没有检查文件内容是否实际发生了变化。 3. 每次服务器重启后,该文件可能被重新生成(即使内容相同),从而再次触发重启。 Suggested solution 希望在文件监听逻辑中增加内容检测机制,只有文件内容确实发生变化时才触发重启。可以通过以下方式实现: 1. 比较文件修改前后的哈希值或内容差异 2. 忽略仅时间戳变化但内容相同的文件修改 3. 对于像 .eslintrc-auto-import.json 这样的自动生成文件提供特殊处理 Alternative _No response_ Additional context _No response_ Validations [x] Follow our Code of Conduct [x] Read the Contributing Guide. [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

nqdy666 · 8mo ago

Recent fixes

View closed PRs →
xiaoxiaohuayu
feat: add content-based change detection to prevent infinite restart …MergedPR

Description This PR adds content-based change detection to prevent infinite restart loops when watching auto-generated files. Problem: Currently, the plugin triggers server restarts based solely on file system events (modification time), without checking if the file content actually changed. This causes infinite restart loops when watching auto-generated files like , because: These files are frequently rewritten during the build process Even when content is identical, the file modification timestamp changes Each server restart may regenerate the file, triggering another restart Solution: Added contentCheck option (enabled by default) to enable content-based change detection Uses SHA-256 hashing to compare file content before/after changes Maintains a global hash cache that persists across server restarts Only triggers restart when file content actually changes, not just metadata Key Changes: New option: (default: ) Implements getFileHash() using Node.js crypto module Implements hasContentChanged() to compare content hashes Global fileHashes Map keyed by project root to persist across restarts Updated documentation with usage examples Benefits: ✅ Prevents infinite restart loops for auto-generated files ✅ Backward compatible (can be disabled with ) ✅ No performance impact - uses efficient SHA-256 hashing ✅ Works seamlessly with existing configurations Linked Issues Fixes the infinite restart loop issue when monitoring auto-generated configuration files. Additional context Testing: The feature has been tested with the following scenario: 1. Watching file 2. Writing identical content multiple times → No restart triggered ✅ 3. Writing different content → Restart triggered ✅ Example Configuration: ```typescript VitePluginRestart({ restart: ['.eslintrc-auto-import.json'], contentCheck: true, // enabled by default })

xiaoxiaohuayu · 8mo ago
jamie-nzfunds
Vite v7ClosedIssue

Are we planning to support Vite v7?

jamie-nzfunds · 11mo ago
BiscuiTech
feat: added vite 6.0 as peerDepsMergedPR

Description Added vite 6.0. as an available peerDep. Linked Issues fix #27 Additional context

BiscuiTech · 1y ago
Structured data for AI agents

Repository: antfu/vite-plugin-restart. Description: Custom files/globs to restart Vite server Stars: 211, Forks: 15. Primary language: TypeScript. Languages: TypeScript (98.4%), JavaScript (1.6%). License: MIT. Topics: auto-restart, vite, vite-plugin. Latest release: v2.0.0 (8mo ago). Open PRs: 1, open issues: 10. Last activity: 8mo ago. Community health: 85%. Top contributors: antfu, alesvaupotic, khalwat, cpojer, DanielFallon, gTutini, xiaoxiaohuayu, BiscuiTech, NicolaSpadari, markthree.

·@ofershap

Replace github.com with gitshow.dev