I want to create PWA's service worker file by using workbox.
According to workbox document, precaching setting of workbox is something like this:
service-worker.js
workbox.precaching.precacheAndRoute([
'/styles/example.ac29.css',
{ url: '/index.html', revision: 'abcd1234' },
// ... other entries ...
]);
But what is the actual meaning of /index.html
or /styles/example.ac29.css
?
It is server root? or, the root of PWA's scope?
For example, if service-worker.js
is served in https://example.com/hoge/fuga/service-worker.js
, and manifest.json
is also served in https://example.com/hoge/fuga/manifest.json
with content:
{
"name": "Great PWA site",
"background_color": "#f6f0d3",
"icons": [...],
"start_url": "https://example.com/hoge/fuga/",
"scope":"/hoge/fuga/",
"display": "standalone"
}
In such case, /index.html
in workbox setting means https://example.com/index.html
? Or, https://example.com/hoge/fuga/index.html
?