某天发现 CI 里 Turborepo 缓存怎么都不命中,排查了一晚上,问题出在 turbo.json 的 inputs 配置。
"build": {
"inputs": ["src/**", "!**/*.test.ts"]
}把测试文件排除掉后,缓存命中率立刻上来了。
remote cache 没生效?多半是 inputs 没配对。记录我调试 Turborepo 缓存的一晚。
某天发现 CI 里 Turborepo 缓存怎么都不命中,排查了一晚上,问题出在 turbo.json 的 inputs 配置。
"build": {
"inputs": ["src/**", "!**/*.test.ts"]
}把测试文件排除掉后,缓存命中率立刻上来了。