我的角度项目的目的是实现“添加到主屏幕”的移动功能。在此过程中,我选择了manifest.json /PWA方法,并在index.html(根模板)级别上的项目根文件夹中创建了manifest.json,并使用以下语句在根模板(index.html)的head部分中添加了manifest.json:但是在"ng构建“时,我看到清单文件没有复制到dist,因此在"dev tools->application->清单”中单击"add“时显示了以下错误
角运行在开发模式中。调用enableProdMode()来启用生产模式。找人帮忙!
**localhost/:1 GET http://localhost:4200/src/manifest.json 404 (Not Found)
manifest.json:1 Manifest: Line: 1, column: 1, Unexpected token.**下面的是清单文件:
{
"short_name": "Bus Express",
"name": "BusEx",
"start_url": "/",
"background_color": "#ffffff",
"display": "standalone",
"scope": "/",
"theme_color": "#fff",
"icons": [
{
"src": "/assets/images/rateexpress128.png",
"type": "image/png",
"sizes": "128x128"
},
{
"src": "/assets/images/rateexpress144.png",
"type": "image/png",
"sizes": "144x144"
}
]
}发布于 2018-06-21 21:13:27
发布于 2019-10-22 08:18:05
另外,我在内部将文件名更改为manifest.json,而angular.json包含条目manifest.webmanifest.
发布于 2021-07-06 10:06:05
go to angular.json
add manifest.json location in assets
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.json"
],使用ng serve重新启动开发服务器
https://stackoverflow.com/questions/50976754
复制相似问题