Skip to content

Commit be0d8dc

Browse files
docs: update task output caching guide (#1639)
Hey there, I saw on https://viteplus.dev/guide/cache it says: > <img width="740" height="171" alt="Screenshot 2026-05-20 at 10 18 29 AM" src="https://github.com/user-attachments/assets/b5718eda-dbe4-4ccc-b106-3e61bd5a825c" /> Talking with Evan, I learned this behavior _does_ exist and the docs aren't accurate. Looks like voidzero-dev/vite-task#375 added the functionality & #1628 brought it in. Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
1 parent bf8457b commit be0d8dc

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

docs/guide/cache.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@ When a task runs successfully (exit code 0), its terminal output (stdout/stderr)
1313
If everything matches, the cached output is replayed instantly, and the command does not run.
1414

1515
::: info
16-
Currently, only terminal output is cached and replayed. Output files such as `dist/` are not cached. If you delete them, use `--no-cache` to force a re-run. Output file caching is planned for a future release.
16+
By default, only terminal output is cached and replayed. To cache files produced by a task, configure [`output`](/config/run#output) globs. Matching files are archived after a successful run and restored on a cache hit.
1717
:::
1818

19+
```ts [vite.config.ts]
20+
tasks: {
21+
build: {
22+
command: 'vp build',
23+
output: ['dist/**'],
24+
},
25+
}
26+
```
27+
1928
When a cache miss occurs, Vite Task tells you exactly why:
2029

2130
```

0 commit comments

Comments
 (0)