Skip to content

Commit b53c9b5

Browse files
beejunkchenxsan
andauthored
docs(configuration): Update watchOptions types (#4190)
* docs(watch): Update `watchOptions` types Update `watchOptions` type to reflect what is allowed by `watchpack`. Also adds an additional example. Closes #11903 * Update src/content/configuration/watch.md Co-authored-by: Sam Chen <chenxsan@gmail.com>
1 parent b35de98 commit b53c9b5

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/content/configuration/watch.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ module.exports = {
7070

7171
## `watchOptions.ignored`
7272

73-
`RegExp` [`anymatch`](https://github.com/micromatch/anymatch)
73+
`RegExp` `string` `[string]`
7474

75-
For some systems, watching many file systems can result in a lot of CPU or memory usage. It is possible to exclude a huge folder like `node_modules`:
75+
For some systems, watching many files can result in a lot of CPU or memory usage. It is possible to exclude a huge folder like `node_modules` using a regular expression:
7676

7777
__webpack.config.js__
7878

@@ -85,7 +85,20 @@ module.exports = {
8585
};
8686
```
8787

88-
It is also possible to have and use multiple [anymatch](https://github.com/micromatch/anymatch) patterns:
88+
Alternatively, a glob pattern may be used:
89+
90+
__webpack.config.js__
91+
92+
```javascript
93+
module.exports = {
94+
//...
95+
watchOptions: {
96+
ignored: 'node_modules/**'
97+
}
98+
};
99+
```
100+
101+
It is also possible to use multiple glob patterns:
89102

90103
__webpack.config.js__
91104

0 commit comments

Comments
 (0)