title: npm run watch Error in Cannot read property of 'map' undefined
body: <p>Problem:
  Running the command <code>npm run watch</code> throws and error</p>
  <pre><code>54% building 35/41 modules 6 active /app/docroot/themes/custom/mytheme/node_modules/css-loader/index.js??ref--10-2!/app/docroot/themes/custom/mytheme/node_modules/postcss-loader/src/index.js??postcss5!/app/docroot/themes
   ERROR  Failed to compile with 1 errors          1:25:50 AM
  
   error 
  
  Cannot read property 'map' of undefined
  
   15 assets
  
  ERROR in Cannot read property 'map' of undefined
  [Browsersync] Proxying: https://ps.lndo.site
  </code></pre>
  <p>The Error happens only when the following code is included in my webpack.mix.js file:</p>
  <pre><code>mix.imagemin({
    patterns: [{
      from: '**/*.{png,gif,jpg,jpeg,svg}',
      to: 'images/',
      context: 'src/images/'
    }, {
      from: '**/*.{png,gif,jpg,jpeg,svg}',
      to: 'images/',
      context: 'src/components/'
    }]
    });
  </code></pre>
  <p>Removing the above snippet removes the error but the previous developers on this project had this for a reason.</p>
  <p>I recently updated due to security vulnerabilities and managed to debug a different issue that Copy Plugin introduced a breaking change (already updated in the code above).  However I am unsure that I have all of the configuration correct.</p>
  <p>This I have tried:
  From the command line</p>
  <pre><code>rm -rf node_modules
  rm package.lock
  npm cache clean --force
  npm install
  </code></pre>
  <p>These are the packages in package.json current as of August 27, 2020</p>
  <pre><code>&quot;devDependencies&quot;: {
      &quot;bootstrap&quot;: &quot;^4.3.1&quot;,
      &quot;browser-sync&quot;: &quot;^2.26.12&quot;,
      &quot;browser-sync-webpack-plugin&quot;: &quot;^2.2.2&quot;,
      &quot;copy-webpack-plugin&quot;: &quot;^6.0.3&quot;,
      &quot;cross-env&quot;: &quot;^7.0.2&quot;,
      &quot;husky&quot;: &quot;^4.2.5&quot;,
      &quot;imagemin-webpack-plugin&quot;: &quot;^2.4.2&quot;,
      &quot;jquery&quot;: &quot;^3.5.1&quot;,
      &quot;laravel-mix&quot;: &quot;^5.0.4&quot;,
      &quot;laravel-mix-imagemin&quot;: &quot;^1.0.3&quot;,
      &quot;popper.js&quot;: &quot;^1.16.1&quot;,
      &quot;pretty-quick&quot;: &quot;^2.0.1&quot;,
      &quot;resolve-url-loader&quot;: &quot;^3.1.1&quot;,
      &quot;sass&quot;: &quot;^1.26.10&quot;,
      &quot;sass-loader&quot;: &quot;^8.0.2&quot;,
      &quot;vue-template-compiler&quot;: &quot;^2.6.11&quot;
    },
  &quot;dependencies&quot;: {
      &quot;throttle-debounce&quot;: &quot;^2.3.0&quot;
    }
  </code></pre>
  <p>The packages updated were the following</p>
  <pre><code>    &quot;browser-sync&quot;: &quot;^2.26.7&quot;,
      &quot;copy-webpack-plugin&quot;: &quot;^5.1.1&quot;,
      &quot;husky&quot;: &quot;^4.2.3&quot;,
      &quot;jquery&quot;: &quot;^3.5.0&quot;,
      &quot;sass&quot;: &quot;^1.26.3&quot;,
  
      &quot;throttle-debounce&quot;: &quot;^2.1.0&quot;
  </code></pre>