title: How to force webpack to generate dynamic publicPath for resources
body: <p>I'm trying to figure out how to implement a MicroFrontend Host application that would be able to bootstrap one or more React applications built with webpack. For that purpose I need to force the application to load its resources from some different URL - and not just using relative paths.</p>
  
  <p>Webpack has a nice feature for setting the public path: <a href="https://webpack.js.org/guides/public-path/" rel="noreferrer">https://webpack.js.org/guides/public-path/</a> However there are some limitations:</p>
  
  <ul>
  <li>if I don't apply it at build time then everything that is rendered in the index.html file will not have it included</li>
  <li>it is a global variable which makes it unusable for my case - I cannot set two different values for two different micro frontends</li>
  </ul>
  
  <p>Is there any way to make such a public url dynamic for an application built with webpack?
  I can live with the fact that I will have to manually update all urls in index.html, but then all the other resources (images, etc) I'd like to be able to get from some other URL.
  This is in general similar to hosting all the resources generated by webpack on a CDN and having index.html still served from a web server with a different address. </p>