title: Webpack v4 with multiple entries on a single page, chunks are duplicated unnecessarily
body: <p>I have a multipage website with a subset of pages that is a SPA. We just upgraded to Webpack V4 and have encountered some new issues that we havent seen before.</p>
  
  <p>Our pages <em>always</em> include a script tag for <strong>app.build.js</strong>. This file has global inits, and imports our public path. It imports things like Modernizr and builds our site navigation.</p>
  
  <p>Additionally, on a per-page basis we serve a second JS file like <strong>account.build.js</strong>. Some pages do not have this second file if they are very simple. They still need app.build.js to create the navigation though.</p>
  
  <p>It appears as though Webpack doesn't know about this combination, so there are redundant chunks in the two output files. they both may include a Modernizr test, etc. and all of that gets added to both build files bloating them significantly.</p>
  
  <p>My question is, how do you tell Webpack that <strong>app.build.js</strong> is globally included??? We do this with SplitChunks for our vendors, but it matches on imports, not on the entry file name. </p>
  
  <p>We also now need to <code>import './public-path';</code> in every entry file, which isn't ideal. I would prefer to do it once in <strong>app.build.js</strong> and have it globally recognized.</p>
  
  <p>Bug filed with Webpack here: <a href="https://github.com/webpack/webpack/issues/8842" rel="nofollow noreferrer">https://github.com/webpack/webpack/issues/8842</a></p>