My website has different paths (rather than different host names) depending on the build config, like:
I'm using ServiceWorkerBaseUrl and ManifestBaseUrl to set the base accordingly.
However, this only works once. Once the index.html contains the manifest and service worker URLs, MSBuild no longer touches it:
Condition="'$(IndexLines.Contains($(ServiceWorkerRegisterFileName)))'=='false'"
This logic doesn't really work when switching between different URLs as described above.
Two possible approaches:
- don't edit the
index.html at all, but rather create an intermediary version
- edit it, but improve the
Condition such that the edited line can still be updated
My website has different paths (rather than different host names) depending on the build config, like:
I'm using
ServiceWorkerBaseUrlandManifestBaseUrlto set the base accordingly.However, this only works once. Once the
index.htmlcontains the manifest and service worker URLs, MSBuild no longer touches it:This logic doesn't really work when switching between different URLs as described above.
Two possible approaches:
index.htmlat all, but rather create an intermediary versionConditionsuch that the edited line can still be updated