简体   繁体   English

@angular/pwa - 如何自定义我的网络清单

[英]@angular/pwa - How to customize my webmanifest

I have an angular pwa (angular 11.2.8) and I usually generate my production code with我有一个 angular pwa(角度 11.2.8),我通常生成我的生产代码

ng build --prod

in the dist folder, i can locate the pwa manifest.webmanifest file在 dist 文件夹中,我可以找到 pwa manifest.webmanifest 文件

now: I need to change two settings of the manifest file (scope and start url) from现在:我需要更改清单文件的两个设置(范围和开始 url)

"scope": "./",
"start_url": "./",

to

"scope": "/",
"start_url": "/index.html",

And I don't want to do it in the manifest.webmanifest file, as it is not in VCS而且我不想在manifest.webmanifest文件中这样做,因为它不在 VCS 中

where can I store these settings in order to find them in the manifest file at the next build?我可以在哪里存储这些设置以便在下次构建时在清单文件中找到它们?

The source of the manifest file is at src\manifest.webmanifest (by default), which is (should be, if not already) tracked in the source control.清单文件的来源位于src\manifest.webmanifest (默认情况下),它(如果还没有的话,应该在源代码管理中进行跟踪)。 That file is created when adding the @angular/pwa package, and should be checked-in.该文件是在添加@angular/pwa package 时创建的,应该签入。

You can modify that file, and it will be copied over to the dist output at build time.您可以修改该文件,它将在构建时复制到dist output。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM