Proper caching per package #10655
-
SummaryI am new to working in a mono-repo setup & using turbo. I've taken a typescript project of mine & converted it into a mono-repo structure composed of many packages. But I am having issues with the caching feature of turborepo, resulting in all packages being re-built if I change any source code in the entire mono-repo package. Expected behaviorLets say I have packages
Then
Actual behaviorIf I edit any source code, all caches miss and all packages in the entire mono repo need to re-build. Here's the outputted summaries from running the snippet You can see in the turbo summary outputs, for the task I also included my
I have tried going through the documentation but cannot figure out what is wrong with my configuration that causes all caches to miss, even when the hash of all included files stay the same. Thank you in advance for any support on this issue! 🙏 Additional information{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": [
"tsconfig.base.json",
"vitest.config.ts",
"rollup.config.js"
],
"tasks": {
"build": {
"outputLogs": "new-only",
"dependsOn": [
"^build"
],
"inputs": [
"rollup.config.*",
"tsconfig.json",
"src/**"
],
"outputs": [
"dist/**",
"bin/**"
]
},
"build-core": {
"outputLogs": "new-only",
"dependsOn": [
"^build-core"
],
"inputs": [
"rollup.config.*",
"tsconfig.json",
"src/**"
],
"outputs": [
"dist/**",
"bin/**"
]
}
}
} ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay I was able to figure this out finally. I had my Removing it as a dev dependency from the root |
Beta Was this translation helpful? Give feedback.
Okay I was able to figure this out finally. I had my
@dothome/cli
package as a dev dependency in the rootpackage.json
. This meant any update to my cli package or the packages it depended on would updatehashOfInternalDependencies
--> which updates the global cache.Removing it as a dev dependency from the root
package.json
resolved the issue. 😄