title: Firebase hosting, Webpack and caching issues
body: <p>I'm using Webpack to build my React project, and I deploy it with Firebase hosting. It's a SPA, the <code>index.html</code> loads a single JS bundle, it all works great.</p>
  
  <p>Except that sometimes, I get this error from some users:</p>
  
  <blockquote>
    <p>SyntaxError: Unexpected token <code>&lt;</code></p>
    
    <p>File <a href="https://tribeez.com/aa298947341ff919a5feecdc7367a6145a4a7d87.js" rel="nofollow noreferrer">https://tribeez.com/aa298947341ff919a5feecdc7367a6145a4a7d87.js</a> line 1
    col 1 in [anonymous]</p>
  </blockquote>
  
  <p>It means that the JS bundle returned some HTML instead, and that happens when the file does not exist, thus returning the content of my <code>index.html</code>.</p>
  
  <p>My <code>firebase.json</code> is quite basic:</p>
  
  <pre><code>{
    "hosting": {
      "public": "dist",
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    }
  }
  </code></pre>
  
  <p>So I was thinking, it must be when a visitor's browser is trying to fetch an older version of the JS bundle, but how can this happen? How can it load an older version of <code>index.html</code> (from its cache then) but can not load its related JS bundle from its cache too?</p>
  
  <p>Should I tell Webpack to always create the JS bundle with the same filename and let Firebase Hosting handle the caching? Or should I handle this differently?</p>