Skip to content

Commit 4bdd31b

Browse files
spicalousmontogeek
authored andcommitted
docs(configuration) Include a tip for require.context and watching (#2245)
* Include a tip for require.context and watching * Amend strings to use single quotes
1 parent ba83219 commit 4bdd31b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/content/configuration/watch.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ contributors:
77
- SpaceK33z
88
- EugeneHlushko
99
- byzyk
10+
- spicalous
1011
---
1112

1213
webpack can watch files and recompile whenever they change. This page explains how to enable this and a couple of tweaks you can make if watching does not work properly for you.
@@ -74,17 +75,19 @@ module.exports = {
7475
};
7576
```
7677

77-
It is also possible to use [anymatch](https://github.com/micromatch/anymatch) patterns:
78+
It is also possible to have and use multiple [anymatch](https://github.com/micromatch/anymatch) patterns:
7879

7980
```js
8081
module.exports = {
8182
//...
8283
watchOptions: {
83-
ignored: 'files/**/*.js'
84+
ignored: ['files/**/*.js', 'node_modules']
8485
}
8586
};
8687
```
8788

89+
T> If you use `require.context`, webpack will watch your entire directory. You will need to ignore files and/or directories so that unwanted changes will not trigger a rebuild.
90+
8891

8992
## `watchOptions.poll`
9093

0 commit comments

Comments
 (0)