Skip to content

precacheAndRoute ​

Function @vite-pwa/workbox-swkit/precaching
ts
precacheAndRoute(entries: string | PrecacheEntry[], options?: PrecacheOptions): void

This method will add entries to the precache list and add a route to respond to fetch events.

This is a convenience method that will call workbox-precaching.precache and workbox-precaching.addRoute in a single call.

Parameters ​

  • entries – Array of entries to precache.

  • options – See the workbox-precaching.PrecacheRoute options.

Released under the MIT License.