Restart servers on dep change
turbo watch re-runs builds; interruptible restarts stale servers.
Turborepo docsturborepo.dev
turbo watch will restart interruptible tasks when dependencies change.
From turborepo, watch/RULE.md.
The server kept old code
turbo watch dev is running. Edit utils, then hit the API.
Persistent onlyBad
"dev": { "persistent": true }InterruptibleGood
"interruptible": true// apps/api: "dev": "node dist/server.js" (no watcher of its own)
{
"tasks": {
"build": { "dependsOn": ["^build"], "outputs": ["dist/**"] },
"dev": {
"dependsOn": ["^build"],
"persistent": true,
"interruptible": true, // turbo watch may restart it
"cache": false
}
}
}
turbo watch dev
Why it matters, pros and cons
Why it matters
turbo watch rebuilds the changed package and its dependents, but a plain Node server has already loaded the old files.
Pros
- Dependency edits reach the running server.
- Tools with their own watchers (
next dev) keep them. - Rebuilds follow the task graph.
Cons
- A restart drops in-memory state.
- Caching in watch mode is experimental.
- Outputs in git can loop; keep them ignored.