Skip to content

Commit

Permalink
Merge branch 'master' of github.com:privatenumber/tsx into kingston/i…
Browse files Browse the repository at this point in the history
…gnore-absolute-patterns
  • Loading branch information
privatenumber committed Oct 16, 2024
2 parents 5bb6d3e + 315d5f4 commit 2d3dc2e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/watch-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,30 @@ By default, _tsx_ watches all imported files, except those in the following dire
- `dist`
- Hidden directories (`.*`)

## Ignoring files
## Customizing watched files

To exclude specific files from being watched, use the `--exclude` flag:
### Including files to watch

To include specific files or directories to watch, use the `--include` flag:

```sh
tsx watch --exclude ./ignore-me.js --exclude ./ignore-me-too.js ./file.ts
tsx watch --include ./other-dep.txt --include "./other-deps/*" ./file.ts
```

### Using glob patterns

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:
### Excluding files from watch
To exclude specific files from being watched, use the `--exclude` flag:

```sh
tsx watch --exclude "./data/**/*" ./file.ts
tsx watch --exclude ./ignore-me.js --exclude ./ignore-me-too.js ./file.ts
```

## Including files to watch
### Using glob patterns

To include specific files or directories to watch, use the `--include` flag:
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:

```sh
tsx watch --include ./other-dep.txt --include "./other-deps/*" ./file.ts
tsx watch --exclude "./data/**/*" ./file.ts
```

## Tips
Expand Down

0 comments on commit 2d3dc2e

Please sign in to comment.