title: Webpack multiple resolve.alias lists for multiple entries
body: <p>I'm trying to convert our old require.js grunt built application to webpack. In our current grunt setup we build two different bundles and we have a bootstrap file where we decide which bundle we require when we start the application.</p>
  
  <p>I thought that we should keep this structure when switching over to webpack. However when I tried to configure webpack with multiple entries I ran into issue where I cannot provide separate resolve alias lists for separate entry points. I need to be able to provide those alias lists because we have many modules that require other modules by module-name i.e. <code>require("my-module")</code> and we have different <code>my-module</code> instances in both bundles. </p>
  
  <p>I couldn't find a way to achieve this with webpack. It might be that I'm locked in to this mindset and cannot see an alternative solution for this problem, so any advice is welcome!</p>
  
  <p>Here's the code what I would like to do:</p>
  
  <p>webpack.config.js</p>
  
  <pre><code>module.exports = {
    entry: {
      cats: ["./app/app-cats"],
      dogs: ["./app/app-dogs"]
    },
    output: {
      path: path.join(__dirname, "bin"),
      filename: "[name].entry.js"
    },
    resolve: {
      alias: {
        // I would like to provide both entry points their own
        // list of aliases, but currently webpack is not supporting this.
        cats: {
          animals: './cats.js'
        },
        dogs: {
          animals: './dogs.js'
        },
      }
    },
  };
  </code></pre>
  
  <p>Here are the rest of the files to illustrate how our current build works:</p>
  
  <p>cats.js</p>
  
  <pre><code>var cats = ['dave', 'henry', 'martha'];
  module.exports = cats;
  </code></pre>
  
  <p>dogs.js</p>
  
  <pre><code>var dogs = ['hulda', 'hilla'];
  module.exports = dogs;
  </code></pre>
  
  <p>app-cats.js</p>
  
  <pre><code>var animals = require('animals')
  console.log(animals);
  </code></pre>
  
  <p>app-dogs.js</p>
  
  <pre><code>var animals = require('animals')
  console.log(animals);
  </code></pre>