angular-cli-ghpages icon indicating copy to clipboard operation
angular-cli-ghpages copied to clipboard

start_url field in webmanifest is not updated, if --base-href is provided

Open pacoita opened this issue 4 years ago • 3 comments

If we have an app using a webmanifest file and we deploy using the --base-href option, the manifest file deployed in the gh-pages branch, should also have the same value used for the --base-href option in order to work properly.

Using the command: ng deploy --base-href=/the-repositoryname/

Should update the manifest file, before building:

{
 ...
 "start_url": "/the-repositoryname/"
}

pacoita avatar Apr 23 '20 09:04 pacoita

I'm open for a PR, that detects the use-case and alters the given file! 👍

JohannesHoppe avatar Apr 23 '20 09:04 JohannesHoppe

I will gladly contribute. I will have a look at the source code in the next days.

If you could point me which would be the best file/code portion to add some new behavior before the build it will save some time. Otherwise I will try to find it 👍

pacoita avatar Apr 23 '20 09:04 pacoita

Awesome.

Right now the build is already altered, e.g. it adds a 404.html file: https://github.com/angular-schule/angular-cli-ghpages/blob/a46dd64de375ba14d25f327052a631dc54050209/src/engine/engine.ts#L173

You could add a new check that verifies that we are right now dealing with a PWA and some code that changes the manifest-file if required.

JohannesHoppe avatar Apr 23 '20 09:04 JohannesHoppe