get-manifest.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. "use strict";
  2. /*
  3. Copyright 2018 Google LLC
  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. */
  8. Object.defineProperty(exports, "__esModule", { value: true });
  9. exports.getManifest = void 0;
  10. const get_file_manifest_entries_1 = require("./lib/get-file-manifest-entries");
  11. const validate_options_1 = require("./lib/validate-options");
  12. /**
  13. * This method returns a list of URLs to precache, referred to as a "precache
  14. * manifest", along with details about the number of entries and their size,
  15. * based on the options you provide.
  16. *
  17. * ```
  18. * // The following lists some common options; see the rest of the documentation
  19. * // for the full set of options and defaults.
  20. * const {count, manifestEntries, size, warnings} = await getManifest({
  21. * dontCacheBustURLsMatching: [new RegExp('...')],
  22. * globDirectory: '...',
  23. * globPatterns: ['...', '...'],
  24. * maximumFileSizeToCacheInBytes: ...,
  25. * });
  26. * ```
  27. *
  28. * @memberof workbox-build
  29. */
  30. async function getManifest(config) {
  31. const options = (0, validate_options_1.validateGetManifestOptions)(config);
  32. return await (0, get_file_manifest_entries_1.getFileManifestEntries)(options);
  33. }
  34. exports.getManifest = getManifest;