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