Skip to content

Commit b10a957

Browse files
committed
docs: add input empty example
1 parent efbe1ed commit b10a957

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

docs/guide/automatic-tracking.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,18 @@ tasks: {
8787
}
8888
```
8989

90-
Set `input: []` when no files should affect the cache fingerprint. Set `output: []` when no files should be restored on a cache hit.
90+
Set `input: []` rarely. Use it when no files should affect the cache fingerprint. For example, a download task can be cached when the same URL always serves the same file. Only changes to the command, such as changing the URL, invalidate the cache:
91+
92+
```ts [vite.config.ts]
93+
tasks: {
94+
downloadSchema: {
95+
command: 'curl -O https://example.com/schema.json',
96+
input: [],
97+
},
98+
}
99+
```
100+
101+
Set `output: []` when no files should be restored on a cache hit.
91102

92103
## Cooperative Tracking
93104

0 commit comments

Comments
 (0)