You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/configuration/watch.md
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,12 @@ contributors:
5
5
- sokra
6
6
- skipjack
7
7
- SpaceK33z
8
+
- EugeneHlushko
8
9
---
9
10
10
11
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.
11
12
13
+
12
14
## `watch`
13
15
14
16
`boolean`
@@ -21,6 +23,7 @@ watch: false
21
23
22
24
T> In webpack-dev-server and webpack-dev-middleware watch mode is enabled by default.
23
25
26
+
24
27
## `watchOptions`
25
28
26
29
`object`
@@ -34,6 +37,7 @@ watchOptions: {
34
37
}
35
38
```
36
39
40
+
37
41
## `watchOptions.aggregateTimeout`
38
42
39
43
`number`
@@ -44,6 +48,7 @@ Add a delay before rebuilding once the first file changed. This allows webpack t
44
48
aggregateTimeout:300// The default
45
49
```
46
50
51
+
47
52
## `watchOptions.ignored`
48
53
49
54
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`:
@@ -58,6 +63,7 @@ It is also possible to use [anymatch](https://github.com/es128/anymatch) pattern
58
63
ignored:"files/**/*.js"
59
64
```
60
65
66
+
61
67
## `watchOptions.poll`
62
68
63
69
`boolean``number`
@@ -71,6 +77,17 @@ poll: 1000 // Check for changes every second
71
77
T> If watching does not work for you, try out this option. Watching does not work with NFS and machines in VirtualBox.
72
78
73
79
80
+
## `info-verbosity`
81
+
82
+
`string`: `none``info``verbose`
83
+
84
+
Controls verbosity of the lifecycle messaging, e.g. the `Started watching files...` log. Setting `info-verbosity` to `verbose` will also message to console at the beginning and the end of incremental build. `info-verbosity` is set to `info` by default.
85
+
86
+
```bash
87
+
webpack --watch --info-verbosity verbose
88
+
```
89
+
90
+
74
91
## Troubleshooting
75
92
76
93
If you are experiencing any issues, please see the following notes. There are a variety of reasons why webpack might miss a file change.
0 commit comments