diff --git a/src/content/configuration/watch.md b/src/content/configuration/watch.md index 8284d9470540..475440ef353c 100644 --- a/src/content/configuration/watch.md +++ b/src/content/configuration/watch.md @@ -5,10 +5,12 @@ contributors: - sokra - skipjack - SpaceK33z + - EugeneHlushko --- 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. + ## `watch` `boolean` @@ -21,6 +23,7 @@ watch: false T> In webpack-dev-server and webpack-dev-middleware watch mode is enabled by default. + ## `watchOptions` `object` @@ -34,6 +37,7 @@ watchOptions: { } ``` + ## `watchOptions.aggregateTimeout` `number` @@ -44,6 +48,7 @@ Add a delay before rebuilding once the first file changed. This allows webpack t aggregateTimeout: 300 // The default ``` + ## `watchOptions.ignored` 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 ignored: "files/**/*.js" ``` + ## `watchOptions.poll` `boolean` `number` @@ -71,6 +77,17 @@ poll: 1000 // Check for changes every second T> If watching does not work for you, try out this option. Watching does not work with NFS and machines in VirtualBox. +## `info-verbosity` + +`string`: `none` `info` `verbose` + +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. + +```bash +webpack --watch --info-verbosity verbose +``` + + ## Troubleshooting If you are experiencing any issues, please see the following notes. There are a variety of reasons why webpack might miss a file change.