<p dir="auto">My goal is to separate the app code and the vendor code in two different chunks. This works, but my issue is that the vendor chunk changes slightly based on the content of the app chunk. If I for instance require a new file in the app chunk there are some ID's and stuff in the vendor chunk that changes and I need to check that big file into source control every time.</p>
<p dir="auto">I would very much prefer if the vendor chunk would be consistent between builds, even if the app code changes. I'm using the OccurenceOrderPlugin but it doesn't seem to help achieving this.</p>
<p dir="auto">Is there anything I am doing wrong, or is this currently how Webpack works by design?</p>
<p dir="auto">My config file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="webpack({
  entry: {
    vendor: [&quot;react&quot;, &quot;react-router&quot;, &quot;lodash&quot;, &quot;jquery&quot;, &quot;bluebird&quot;],
    app: &quot;app.js&quot;,
  },
  output: {
    path: paths.jsPublicDev,
    filename: &quot;app.bundle.js&quot;,
  },
  plugins: [
    new webpack.optimize.OccurenceOrderPlugin(true),
    new webpack.optimize.CommonsChunkPlugin({
      name: &quot;vendor&quot;,
      filename: &quot;vendor.bundle.js&quot;,
      minChunks: Infinity, 
      }),
    ],
   }
})"><pre class="notranslate"><code class="notranslate">webpack({
  entry: {
    vendor: ["react", "react-router", "lodash", "jquery", "bluebird"],
    app: "app.js",
  },
  output: {
    path: paths.jsPublicDev,
    filename: "app.bundle.js",
  },
  plugins: [
    new webpack.optimize.OccurenceOrderPlugin(true),
    new webpack.optimize.CommonsChunkPlugin({
      name: "vendor",
      filename: "vendor.bundle.js",
      minChunks: Infinity, 
      }),
    ],
   }
})
</code></pre></div>
<p dir="auto">Apart from this, Webpack works very well for me. Thank you!</p>
<p dir="auto">I'm trying to split my vendor code from my app code and got it all working. However, every time I change some code in my app and create a new build, the vendor file gets a new chunkhash and thus is downloaded by the clients again. The contents are exactly the same though.</p>
<p dir="auto">Here is a fully working small example showing the problem: <a href="https://github.com/kevinrenskers/chunkhash-problem">https://github.com/kevinrenskers/chunkhash-problem</a></p>
<p dir="auto">And as you can see, the contents of these files are 100% identical even though the chunkhash keeps changing:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/229384/8997650/7d59d360-3713-11e5-9ea6-691012429126.png"><img src="https://cloud.githubusercontent.com/assets/229384/8997650/7d59d360-3713-11e5-9ea6-691012429126.png" alt="screen shot 2015-07-30 at 22 47 59" style="max-width: 100%;"></a></p>