title: Ignoring files with Webpack Dev Server
body: <p>I am using Emacs to edit the files in directories watched by Webpack's development server. Every time I make a change in a file, a backup file gets created in the same directory, like <code>.#original_filename</code>, even though I did not save the changes in Emacs. This causes the server's watcher to register a change even though I did not make one. Hence the server reloads every time I make a change in the file, and then does another reload when I save it. </p>
  
  <p>This is somewhat confusing and time consuming. Looking at <a href="https://webpack.js.org/configuration/watch/" rel="noreferrer">Webpack's documentation</a>, I found out about the following option:</p>
  
  <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
    node_modules:</p>
  
  <pre><code>ignored: /node_modules/ 
  </code></pre>
    
    <p>It is also possible to use anymatch patterns:</p>
  
  <pre><code>ignored: "files/**/*.js"
  </code></pre>
  </blockquote>
  
  <p>So I modified my config like below, to match and ignore the files starting with <code>.</code>:</p>
  
  <pre><code>devServer: {
      ...
      watchOptions: {
          ignored: './src/app/**/.*',
      },
      ...
  }
  </code></pre>
  
  <p>I restart the dev server, but the watcher still registers the backup files as changes done to the codebase. What am I doing wrong?</p>