Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow ignore patterns to apply to absolute path instead of relative path #656

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions docs/watch-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,26 @@ By default, _tsx_ watches all imported files, except those in the following dire

## Ignoring files

To exclude specific files or directories from being watched, use the `--ignore` flag:
To exclude specific files from being watched, use the `--exclude` flag:

```sh
tsx watch --ignore ./ignore-me.js --ignore ./ignore-me-too.js ./file.ts
tsx watch --exclude ./ignore-me.js --exclude ./ignore-me-too.js ./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:

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

## Including files to watch

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

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

## Tips
Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@
"devDependencies": {
"@ampproject/remapping": "^2.3.0",
"@types/cross-spawn": "^6.0.6",
"@types/glob-parent": "^5.1.3",
"@types/is-glob": "^4.0.4",
"@types/node": "^20.14.9",
"@types/normalize-path": "^3.0.2",
"@types/picomatch": "^3.0.1",
"@types/split2": "^4.2.3",
"append-transform": "^2.0.0",
"cachedir": "^2.4.0",
"chokidar": "^3.6.0",
"chokidar": "^4.0.1",
"clean-pkg-json": "^1.2.0",
"cleye": "^1.3.2",
"cross-spawn": "^7.0.3",
Expand All @@ -92,13 +96,17 @@
"fs-fixture": "^2.4.0",
"fs-require": "^1.6.0",
"get-node": "^15.0.1",
"glob-parent": "^6.0.2",
"is-glob": "^4.0.3",
"kolorist": "^1.8.0",
"lintroll": "^1.8.1",
"magic-string": "^0.30.10",
"manten": "^1.3.0",
"memfs": "^4.9.3",
"node-pty": "^1.0.0",
"normalize-path": "^3.0.0",
"outdent": "^0.8.0",
"picomatch": "^4.0.2",
"pkgroll": "^2.4.1",
"proxyquire": "^2.1.3",
"split2": "^4.2.0",
Expand Down
104 changes: 87 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading