1.0.1 • Published 5 months ago

workbox-mirror-precache-plugin v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

📦 workbox-mirror-precache-plugin

A workbox plugin that fetch precache files from various mirrors.

Usage

npm install workbox-mirror-precache-plugin
import { addPlugins } from "workbox-precaching";
import { cacheNames } from "workbox-core";
import { MirrorPrecachePlugin } from "workbox-mirror-precache-plugin";

const cacheName = cacheNames.precache;
const entries = self.__WB_MANIFEST;
const mirrors = [
  "https://cdn.example.com",
];

addPlugins([
  new MirrorPrecachePlugin({
    entries,
    cacheName,
    prefixs: [self.origin, ...mirrors],
  }),
]);
precacheAndRoute(entries);

License

MIT

1.0.1

5 months ago

1.0.0

5 months ago