title: Dynamic library option with multi entry points
body: <p>I find an example of webpack <a href="https://github.com/webpack/webpack/tree/master/examples/multi-part-library" rel="noreferrer">library option with multiple entry points and UMD</a></p>
  
  <p>Here is the <strong>webpack.config.js</strong> in the example:</p>
  
  <pre><code>var path = require("path");
  module.exports = {
      entry: {
          alpha: "./alpha",
          beta: "./beta"
      },
      output: {
          path: path.join(__dirname, "js"),
          filename: "MyLibrary.[name].js",
          library: ["MyLibrary", "[name]"],
          libraryTarget: "umd"
      }
  }
  </code></pre>
  
  <p>My question is how to config <code>filename</code> &amp; <code>library</code> dynamically. What I want is:</p>
  
  <ul>
  <li><code>filename</code> for entry <code>alpha</code> to be <code>a.js</code></li>
  <li><code>filename</code> for entry <code>beta</code> to be <code>b.js</code></li>
  <li><code>library</code> for entry <code>alpha</code> to be <code>Alpha</code></li>
  <li><code>library</code> for entry <code>beta</code> to be <code>Beta</code>.</li>
  </ul>
  
  <p>So I wonder if I can config these options through a <code>function</code> like this:</p>
  
  <pre><code>var path = require("path");
  module.exports = {
      entry: {
          alpha: "./alpha",
          beta: "./beta"
      },
      output: {
          path: path.join(__dirname, "js"),
          filename: function(entryKey, entryValue) {
              if (entryKey === 'alpha') return 'a.js';
              if (entryKey === 'beta') return 'b.js';
          },
          library: function(entryKey, entryValue) {
              if (entryKey === 'alpha') return 'Alpha';
              if (entryKey === 'beta') return 'Beta';
          },
          libraryTarget: "umd"
      }
  }
  </code></pre>