How to use Cache-Busting with Webpack?
<p>Before Webpack I would always rely on the following pattern for "cache-busting":</p>

<pre><code>&lt;script src="foo.js?cacheBust=12345" /&gt;
</code></pre>

<p>where <code>12345</code> was a token the sever generated for me on every build (it could be a Git hash, although in my case it isn't).</p>

<p>With Webpack I now have two files: <code>build.js</code> and <code>chunk.1.js</code>.  Since I bring the first one in with a normal script tag I can use the above pattern:</p>

<pre><code>&lt;script src="build.js?cacheBust=12345" /&gt;
</code></pre>

<p>However, at that point <code>build.js</code> goes and fetches <code>chunk.1.js</code>, and when it does it doesn't include the cache-busting suffix.</p>

<p>I would like for Webpack to automatically append the <code>?cacheBust=12345</code>, but I don't know the <code>12345</code> part at build time, so I can't include it in my <code>webpack.config</code>.  Instead, I have to wait until the HTML page is evaluated, at which point I get the token from the server.</p>

<p>So, my question is, is there any way to have Webpack look at the parameter used to fetch the initial file (eg. <code>?cacheBust=12345</code>) and append that same parameter when fetching other files?</p>