workbox-mirror-precache-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

📦 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

Readme

Keywords

Package Sidebar

Install

npm i workbox-mirror-precache-plugin

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

45.6 kB

Total Files

35

Last publish

Collaborators

  • seedgou