Skip to content

Commit 315d5f4

Browse files
docs(watch): document --include flag
Co-authored-by: Kingston Tam <[email protected]>
1 parent 375e39a commit 315d5f4

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

docs/watch-mode.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,30 @@ By default, _tsx_ watches all imported files, except those in the following dire
2121
- `dist`
2222
- Hidden directories (`.*`)
2323

24-
## Ignoring files
24+
## Customizing watched files
2525

26-
To exclude specific files or directories from being watched, use the `--ignore` flag:
26+
### Including files to watch
27+
28+
To include specific files or directories to watch, use the `--include` flag:
29+
30+
```sh
31+
tsx watch --include ./other-dep.txt --include "./other-deps/*" ./file.ts
32+
```
33+
34+
35+
### Excluding files from watch
36+
To exclude specific files from being watched, use the `--exclude` flag:
2737

2838
```sh
29-
tsx watch --ignore ./ignore-me.js --ignore ./ignore-me-too.js ./file.ts
39+
tsx watch --exclude ./ignore-me.js --exclude ./ignore-me-too.js ./file.ts
3040
```
3141

3242
### Using glob patterns
3343

3444
Glob patterns allow you to define a set of files or directories to ignore. To prevent your shell from expanding the glob patterns, wrap them in quotes:
3545

3646
```sh
37-
tsx watch --ignore "./data/**/*" ./file.ts
47+
tsx watch --exclude "./data/**/*" ./file.ts
3848
```
3949

4050
## Tips

0 commit comments

Comments
 (0)