When I publish angular pwa application to subfolder in IIS, pwa application not work in offline.
ng build --prod --baseHref=/subfolder/ does not help.
I use https on web site.
How exactly reconfigure angular pwa application to work offline if application is not published to root of IIS but to subfolder of IIS?
Does anybody have functional demo of angular pwa application working offline after publishing to IIS subfolder?
I know I am very late on this, I have also struggled on this and finally followed these steps to solve the issue:
In
manifest.JSON
file, set"scope": "."
and"start_url": "./"
. This indicate that you are using sub-directory.Then build the project using CLI command
ng build --prod --baseHref=/Your_sub_directory_name/
And finally paste the
dist
folder content to your pointedYour_sub_directory_name
IIS location.Then just refresh page and wait to register the service worker, you can check this in application tab of chrome's developer tool. Once service worker is reigstered, just switch to offline mode and you'll the page will work fine in offline.