What is the difference between watchOptions.ignored and webpack.WatchIgnorePlugin : <p>When using webpack with watch, such as when using <code>webpack-dev-server</code> there seem to be (at least) two different ways of excluding files from watching. I can't really find any documentation on the difference between these two configurations and why they are different. Does anyone know why? Is one method preferred? Should I open an issue and/or pull request to improve documentation?</p>

<p>The case I recently ran into where watch was being triggered multiple times on first run was fixed by adding <code>watchIgnorePlugin</code> and not fixed by <code>watchOptions.ignored</code></p>

<h3>webpack.WatchIgnorePlugin</h3>

<blockquote>
  <p>Ignore the specified files, i.e. those matching the provided paths or regular expressions, while in watch mode.</p>

<pre><code>new webpack.WatchIgnorePlugin(paths)
</code></pre>
  
  <p><strong>Options</strong></p>
  
  <ul>
  <li>paths (array): A list of RegExps or absolute paths to directories or'
  files that should be ignored.</li>
  </ul>
  
  <hr>
  
  <p><a href="https://webpack.js.org/plugins/watch-ignore-plugin/" rel="noreferrer">https://webpack.js.org/plugins/watch-ignore-plugin/</a></p>
</blockquote>

<h3>watchOptions.ignored</h3>

<blockquote>
  <p>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 <code>node_modules</code>:</p>

<pre><code> ignored: /node_modules/
</code></pre>
  
  <p>It is also possible to use <a href="https://github.com/es128/anymatch" rel="noreferrer">anymatch</a> patterns:</p>

<pre><code> ignored: "files/**/*.js"
</code></pre>
  
  <hr>
  
  <p><a href="https://webpack.js.org/configuration/watch/" rel="noreferrer">https://webpack.js.org/configuration/watch/</a></p>
</blockquote>
