Open vekexasia opened 1 month ago
turbo watch
does make use of the cache to prevent any partial artifacts from being stored in the cache. I see this isn't documented anywhere so I'll quick add it.
What is the proper way to have a watch rebuild + subdeps?
I don't believe I understand your question. Could you elaborate a bit?
I would like something like watch that honors the inputs of the task so that it triggers only when something matching the inputs changes.
I believe I am having the same issue of turbo watch
not respecting task inputs.
Given a turbo.json like below
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", "src/**/*.ts", "!src/**/*.spec.ts"],
"outputs": ["dist/**"]
}
}
}
When I run turbo run build
, change a test file and run turbo run build
again, I get
Tasks: 3 successful, 3 total
Cached: 3 cached, 3 total
Time: 90ms >>> FULL TURBO
However, when I run turbo watch build
and change a test file, the build task is re-executed each time.
I think this issue is right spirit but wrong to approach this as a bug but as a feature request since turbo documentation explicitly states that caching is disabled for tasks running with watch.
I would like to infact use caching with turbo watch.
My ideal behavior is that when running with turbo watch
, the first run is like with turbo run
where tasks that miss cache are run. After that, I would like it to watch the inputs and re-run tasks for which inputs changed.
Is this currently on a roadmap? Is caching disabled for now because its a planned feature or is there some technical limitation?
Verify canary release
Link to code that reproduces this issue
turborepo/examples/with-rollup
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Linux
Which canary version will you have in your reproduction?
2.1.1
Describe the Bug
i tried the
with-rollup
example as it aligns with my use case.steps:
packages/ui/.eslintrc.cjs
add a new line and savethis gives
FULL TURBO
->>> Oknow:
this gives a
cache miss
with a different hash and rebuildsnotes: if from here you
npx turbo build
again. the hash is the same as in the first stepsExpected Behavior
cache hits like in turbo build
To Reproduce
examples/with-rollup
pnpm i
Additional context
No response