index.mjs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. Copyright 2018 Google LLC
  3. Use of this source code is governed by an MIT-style
  4. license that can be found in the LICENSE file or at
  5. https://opensource.org/licenses/MIT.
  6. */
  7. import {assert} from 'workbox-core/_private/assert.mjs';
  8. import {addPlugins} from './addPlugins.mjs';
  9. import {addRoute} from './addRoute.mjs';
  10. import {cleanupOutdatedCaches} from './cleanupOutdatedCaches.mjs';
  11. import {getCacheKeyForURL} from './getCacheKeyForURL.mjs';
  12. import {precache} from './precache.mjs';
  13. import {precacheAndRoute} from './precacheAndRoute.mjs';
  14. import {PrecacheController} from './PrecacheController.mjs';
  15. import './_version.mjs';
  16. if (process.env.NODE_ENV !== 'production') {
  17. assert.isSWEnv('workbox-precaching');
  18. }
  19. /**
  20. * Most consumers of this module will want to use the
  21. * [precacheAndRoute()]{@link workbox.precaching.precacheAndRoute}
  22. * method to add assets to the Cache and respond to network requests with these
  23. * cached assets.
  24. *
  25. * If you require finer grained control, you can use the
  26. * [PrecacheController]{@link workbox.precaching.PrecacheController}
  27. * to determine when performed.
  28. *
  29. * @namespace workbox.precaching
  30. */
  31. export {
  32. addPlugins,
  33. addRoute,
  34. cleanupOutdatedCaches,
  35. getCacheKeyForURL,
  36. precache,
  37. precacheAndRoute,
  38. PrecacheController,
  39. };