Skip to content

Commit a07b594

Browse files
committed
doc: clarify glob support for --watch-path
1 parent f66eeda commit a07b594

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

doc/api/cli.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3355,7 +3355,8 @@ changes:
33553355
description: Watch mode is now stable.
33563356
-->
33573357

3358-
Starts Node.js in watch mode and specifies what paths to watch.
3358+
Starts Node.js in watch mode and specifies what paths to watch (the paths could
3359+
include glob patterns,e.g., `--watch-path='**/*.js'`).
33593360
When in watch mode, changes in the watched paths cause the Node.js process to
33603361
restart.
33613362
This will turn off watching of required or imported modules, even when used in
@@ -3367,6 +3368,9 @@ This flag cannot be combined with
33673368
Note: Using `--watch-path` implicitly enables `--watch`, which requires a file path
33683369
and is incompatible with `--run`, as `--run` takes precedence and ignores watch mode.
33693370

3371+
When using `--watch-path` with glob patterns, you must include quotations `'<glob-pattern>'` to
3372+
ensure it does not get expanded by the shell interpreter
3373+
33703374
```bash
33713375
node --watch-path=./src --watch-path=./tests index.js
33723376
```

0 commit comments

Comments
 (0)