fix: dts lost in re-compilation if save file with same content #691
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修复存在持久缓存已存在且重复保存某个文件但不修改内容时,
.d.ts
不会生成的问题,另外修改.tsbuildinfo
文件的位置强行让存量项目的 tsc 缓存失效实现缓存重建。原因是 tsc 的 incremental 模式不会生成未变更的文件,father 使用持久缓存补齐这些文件,但缓存 key 不是依据内容哈希而是文件修改时间,所以在文件重复保存时,tsc 认为文件没有变更(应该是以哈希判断?)所以不会生成,father 又从持久缓存中找不到(以时间戳查找)对应内容无法补齐文件,最终导致
.d.ts
丢失。解法是 father 对
.d.ts
的缓存 key 改为内容哈希,确保重复保存时也能命中。Close #669