Skip to content

Commit fb51359

Browse files
committed
docs: add important note about ignore rules
Fixes #2057
1 parent 8fe7d77 commit fb51359

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ A config file can take any of the command line arguments as JSON key values, for
8686
```json
8787
{
8888
"verbose": true,
89-
"ignore": ["*.test.js", "fixtures/*"],
89+
"ignore": ["*.test.js", "**/fixtures/**"],
9090
"execMap": {
9191
"rb": "ruby",
9292
"pde": "processing --sketch={{pwd}} --run"
@@ -109,7 +109,7 @@ Specify the config in the same format as you would for a config file but under `
109109
"homepage": "http://nodemon.io",
110110
"...": "... other standard package.json values",
111111
"nodemonConfig": {
112-
"ignore": ["test/*", "docs/*"],
112+
"ignore": ["**/test/**", "**/docs/**"],
113113
"delay": 2500
114114
}
115115
}
@@ -203,6 +203,8 @@ Patterns can also be ignored (but be sure to quote the arguments):
203203
nodemon --ignore 'lib/*.js'
204204
```
205205

206+
**Important** the ignore rules are patterns matched to the full absolute path, and this determines how many files are monitored. If using a wild card glob pattern, it needs to be used as `**` or omitted entirely. For example, `nodemon --ignore '**/test/**'` will work, whereas `--ignore '*/test/*'` will not.
207+
206208
Note that by default, nodemon will ignore the `.git`, `node_modules`, `bower_components`, `.nyc_output`, `coverage` and `.sass-cache` directories and *add* your ignored patterns to the list. If you want to indeed watch a directory like `node_modules`, you need to [override the underlying default ignore rules](https://github.com/remy/nodemon/blob/master/faq.md#overriding-the-underlying-default-ignore-rules).
207209

208210
## Application isn't restarting

0 commit comments

Comments
 (0)