Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Avoiding app rebuild for a different deployUrl, dynamic deployUrl resolution at runtime #16625
The deploy URL option is fundamentally a build time construct. It is not intended to be a runtime controllable value nor can it as it is injected throughout the output files. This includes the HTML index file via the application script locations and CSS files (both global and component) which must hard-code the value to be considered valid CSS.
The HTML base HREF, however, is the exact opposite and is instead a runtime construct that is applied by the browser itself. It exists in only one location within the entire application (the HTML index file). Its primary purpose is to alter the retrieval location of relatively referenced resources. It can also be dynamically adjusted at runtime by modifying the value in the DOM. An inline script within the head element, for instance, could be used to alter the value based on some criteria before any other scripts/resources are loaded.