title: Webpack2 remove duplicated code from multiple bundles with CommonsChunkPlugin
body: <p>Considering this</p>
  
  <pre><code>[01] [00] WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (250 kB). This can impact web performance.
  [01] [00] Entrypoints:
  [01] [00]   app (5.43 MB)
  [01] [00]       vendor1.bundle.js
  [01] [00]       vendor1.bundle.js.map
  [01] [00]       app.bundle.js
  [01] [00]       styles.css
  [01] [00]       app.bundle.js.map
  [01] [00]       styles.css.map
  [01] [00] 
  [01] [00]   vendor2 (2.37 MB)
  [01] [00]       vendor1.bundle.js
  [01] [00]       vendor1.bundle.js.map
  [01] [00]       vendor2.bundle.js
  [01] [00]       vendor2.bundle.js.map
  [01] [00] 
  [01] [00]   vendor1 (901 kB)
  [01] [00]       vendor1.bundle.js
  [01] [00]       vendor1.bundle.js.map
  </code></pre>
  
  <p>and this webpack configuration</p>
  
  <pre class="lang-js prettyprint-override"><code>   let plugins = () =&gt; {
      let basePLUGINS = [
          new webpack.optimize.CommonsChunkPlugin({
              names: ['vendor1','vendor2'],
              minChunks: Infinity
          }),
          new HtmlWebpackPlugin({
              chunks: ['app'],
              body: true,
              chunksSortMode: 'dependency',
              env: {
                  Prod: args.options.prod
              },
              template: 'src/index.ejs'
          }),
          new webpack.LoaderOptionsPlugin({
              options: {
                  sassLoader: {
                      includePaths: [path.resolve(__dirname, "./src/sass")]
                  },
                  context: '/',
                  postcss: [
                      require("postcss-cssnext")(
                          {
                              browsers: '&gt; 0%',
                              customProperties: true,
                              colorFunction: true,
                              customSelectors: true,
                          })
                  ]
              }
          }),
  
  
      ];
      if (args.options.prod) {
          basePLUGINS.push(
              new ExtractTextPlugin({
                  filename: "styles.css",
                  disable: false,
                  allChunks: true,
                  sourceMapFilename: '[file].map'
              }),
              new webpack.optimize.UglifyJsPlugin({
                  compress: {warnings: false},
                  output: {comments: false},
                  sourceMap: true
              })
          );
          return basePLUGINS
      }
      return basePLUGINS
  
  };
  
  module.exports = {
      entry: {
          app: "./src/ts/app.tsx",
          vendor2: ['react-dom'],
          vendor1: ['react']
      },
      plugins: plugins(),
      output: {
          filename: "[name].bundle.js",
          path: path.join(__dirname, "www")
      },
  </code></pre>
  
  <p>I am clearly packing react 3 times here? CommonsChunkPlugin needs help here
  How can I make so vendor2 and my app dont include react without changing my codebase?
  running webpack2.beta28</p>