title: How to prevent Webpack from running several times from Makefile recipes
body: <p>This is, presumably, more a <code>make</code> than a <code>webpack</code> question.</p>
  
  <p>I'm using good ol' <code>make</code> to manage dependencies and builds, and <code>webpack</code> for building JS components. Example:</p>
  
  <p>Makefile:</p>
  
  <pre><code>foo.js: src/foo.js
      webpack -p
  
  bar.js: src/bar.js
      webpack -p
  </code></pre>
  
  <p><code>webpack.config.js</code>:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var webpack = require('webpack');
  
  module.exports = {
      entry: {
        'foo': './src/foo.js',
        'bar': './src/bar.js',
      },
      output: {
          path: './',
          filename: '[name].js',
      }
  };</code></pre>
  </div>
  </div>
  </p>
  
  <p>Quite obviously, every time when any of <code>src/{foo,bar}.js</code> changes, Webpack runs and builds both files. This might not be fixable, as I've read that this is on purpose (to cater for possible interactions between the modules).</p>
  
  <p>However, when <em>both</em> change, Webpack will run twice, because the recipes don't know of each other. This is unnecessary and gets out of hand quickly.</p>
  
  <p>Is there any possibility to "collect" the files and make Webpack only run once, independently of how many source files changed?</p>