gpt4 book ai didi

Angular 7 PWA - 离线模式下缺少 Font Awesome 图标

转载 作者:行者123 更新时间:2023-12-02 10:18:40 24 4
gpt4 key购买 nike

问题是在离线模式下,字体很棒的图标不会显示。在离线模式下,我可以看到“网络”选项卡中状态为失败的文件是

  1. 在dist文件夹中生成&
  2. 在“应用程序”选项卡的缓存中 - 例如/fa-solid-900.fb493903265cad425ccd.woff2

非常感谢对此的任何帮助。详细信息如下 - 提前致谢。

阿米特·科利

包文件中的相关条目是 -

"@angular/animations": "7.1.3",
"@angular/common": "7.1.3",
"@angular/compiler": "7.1.3",
"@angular/core": "7.1.3",
"@angular/forms": "7.1.3",
"@angular/http": "7.1.3",
"@angular/platform-browser": "7.1.3",
"@angular/platform-browser-dynamic": "7.1.3",
"@angular/pwa": "^0.10.6",
"@angular/router": "7.1.3",
"@angular/service-worker": "7.1.3",
"@fortawesome/fontawesome-free": "^5.5.0",

在 ngsw-config.json 中 - ...

"/favicon.ico",
"/index.html",
"/*.css",
"/*.js",
"/*.woff",
"/*.woff2",
"/*.ttf",
"/fontawesome-webfont*"
]

Manifest.json -

  "short_name": "TALSWeb",
"theme_color": "#00A160",
"background_color": "#fafafa",
"display": "standalone",
"scope": "/",
"start_url": "/",

生成的 ngsw.json 文件摘录 -

"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"updateMode": "prefetch",
"urls": [
"/fa-brands-400.659c4d58b00226541ef9.woff2",
"/fa-brands-400.8b7a9afd7b95f62e6ee8.woff",
"/fa-brands-400.b69de69a4ff8ca0abe96.ttf",
"/fa-regular-400.0b5e3a5451fc62d9023c.woff",
"/fa-regular-400.b48c48ea8457846a5695.ttf",
"/fa-regular-400.bdadb6ce95c5a2e7b673.woff2",
"/fa-solid-900.48f54f63d7711d0912a9.ttf",
"/fa-solid-900.bcb927a742a8370b7664.woff",
"/fa-solid-900.fb493903265cad425ccd.woff2",
"/favicon.ico",
"/index.html",
"/main.cbcf9854dbe01b31ca0f.js",
"/polyfills.fab331e3b568bcb25c34.js",
"/runtime.a66f828dca56eeb90e02.js",
"/scripts.8d6556ad089996471ba5.js",
"/styles.e844927534017e9a8be0.css"
],

in offline mode missing files are in the cache.PNG

最佳答案

这是我的配置:

"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)",
"/*-es5*.js"
],
"urls": [
"https://fonts.googleapis.com/**"
]
}

关于Angular 7 PWA - 离线模式下缺少 Font Awesome 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53769929/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com