UNPKG

870 BJavaScriptView Raw
1/*
2 Copyright 2019 Google LLC
3
4 Use of this source code is governed by an MIT-style
5 license that can be found in the LICENSE file or at
6 https://opensource.org/licenses/MIT.
7*/
8import { addRoute } from './addRoute.js';
9import { precache } from './precache.js';
10import './_version.js';
11/**
12 * This method will add entries to the precache list and add a route to
13 * respond to fetch events.
14 *
15 * This is a convenience method that will call
16 * {@link workbox-precaching.precache} and
17 * {@link workbox-precaching.addRoute} in a single call.
18 *
19 * @param {Array<Object|string>} entries Array of entries to precache.
20 * @param {Object} [options] See the
21 * {@link workbox-precaching.PrecacheRoute} options.
22 *
23 * @memberof workbox-precaching
24 */
25function precacheAndRoute(entries, options) {
26 precache(entries);
27 addRoute(options);
28}
29export { precacheAndRoute };