feat(aio): cache external resources in the ServiceWorker
Cache resources that are necessary for displaying the basic pages when offline.
This commit is contained in:
parent
a9027a2570
commit
749bcf3d9c
|
@ -1,4 +1,14 @@
|
||||||
{
|
{
|
||||||
|
"external": {
|
||||||
|
"urls": [
|
||||||
|
{"url": "https://fonts.googleapis.com/css?family=Droid+Sans+Mono"},
|
||||||
|
{"url": "https://fonts.gstatic.com/s/droidsansmono/v7/ns-m2xQYezAtqh7ai59hJYdJ2JT0J65PSe7wdxAnx_I.woff2"},
|
||||||
|
{"url": "https://fonts.googleapis.com/icon?family=Material+Icons"},
|
||||||
|
{"url": "https://fonts.gstatic.com/s/materialicons/v22/2fcrYFNaTjcS6g4U3t-Y5ZjZjT5FdEJ140U2DJYC3mY.woff2"},
|
||||||
|
{"url": "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"},
|
||||||
|
{"url": "https://unpkg.com/lunr@0.7.2/lunr.min.js"}
|
||||||
|
]
|
||||||
|
},
|
||||||
"static.ignore": [
|
"static.ignore": [
|
||||||
"\\.js\\.map$",
|
"\\.js\\.map$",
|
||||||
"^/assets/images/.*/unused/",
|
"^/assets/images/.*/unused/",
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
var SEARCH_TERMS_URL = '/content/docs/app/search-data.json';
|
var SEARCH_TERMS_URL = '/content/docs/app/search-data.json';
|
||||||
|
|
||||||
importScripts('https://unpkg.com/lunr@0.7.2');
|
// NOTE: This needs to be kept in sync with `ngsw-manifest.json`.
|
||||||
|
importScripts('https://unpkg.com/lunr@0.7.2/lunr.min.js');
|
||||||
|
|
||||||
var index = createIndex();
|
var index = createIndex();
|
||||||
var pages = {};
|
var pages = {};
|
||||||
|
|
|
@ -20,9 +20,11 @@
|
||||||
<link rel="icon" type="image/png" href="assets/images/favicons/favicon-16x16.png"
|
<link rel="icon" type="image/png" href="assets/images/favicons/favicon-16x16.png"
|
||||||
sizes="16x16">
|
sizes="16x16">
|
||||||
|
|
||||||
|
<!-- NOTE: These need to be kept in sync with `ngsw-manifest.json`. -->
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Droid+Sans+Mono" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Droid+Sans+Mono" rel="stylesheet">
|
||||||
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"rel="stylesheet">
|
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"rel="stylesheet">
|
||||||
|
<!-- -->
|
||||||
|
|
||||||
<link rel="manifest" href="pwa-manifest.json">
|
<link rel="manifest" href="pwa-manifest.json">
|
||||||
<meta name="theme-color" content="#1976d2">
|
<meta name="theme-color" content="#1976d2">
|
||||||
|
|
Loading…
Reference in New Issue