サービスワーカー
A service worker is a script that sits between a web app and the network. It can cache the app's files so that repeat visits load without waiting on the network, and so the app works offline.
For apps built with the www output target, Stencil can generate a service worker for you using Workbox, and register it in your index.html.
注記
Service workers are for apps. A component library has no use for one.
使用法
Install workbox-build, the package Stencil uses to generate the service worker:
- npm
- Yarn
- pnpm
npm install --save-dev workbox-build