title: webpack export classes from multiple entry files
body: <p>I'm using webpack to bundle up a framework for use by 3rd parties. This framework should expose multiple ES6 classes. Building in a modular fashion, I have written one class per file. What I want to do is build all these files together, and have them bundled up under a given &quot;namespace&quot;. Example:</p>
  <p>apples.js <code>export class Apples {...}</code><br />
  oranges.js <code>export class Oranges {...}</code></p>
  <p>webpack.config.js:</p>
  <pre><code>module.exports = {
    entry: ['./src/apples.js', './src/oranges.js'],
    output: {
      path: './dist',
      filename: 'fruit.js',
      library: 'Fruit',
      libraryTarget: 'umd'
    }
  }
  </code></pre>
  <p>However, if I load up this library in the browser and type <code>Fruit</code> into the console, I only see the Oranges object under Fruit. Only the last entry file is being exposed back out in the library. Surely enough, the webpack docs confirm this behavior:</p>
  <blockquote>
  <p>If you pass an array: All modules are loaded upon startup. The last one is exported.
  <a href="http://webpack.github.io/docs/configuration.html#entry" rel="nofollow noreferrer">http://webpack.github.io/docs/configuration.html#entry</a></p>
  </blockquote>
  <p>My current workaround is to export all my classes from one file, but it's getting pretty unwieldy.</p>
  <p>How can I go about setting up a library with multiple entry files that are all exported? Or am I going about something the wrong way here?</p>