inject-manifest.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930
  1. import { BuildResult, InjectManifestOptions } from './types';
  2. /**
  3. * This method creates a list of URLs to precache, referred to as a "precache
  4. * manifest", based on the options you provide.
  5. *
  6. * The manifest is injected into the `swSrc` file, and the placeholder string
  7. * `injectionPoint` determines where in the file the manifest should go.
  8. *
  9. * The final service worker file, with the manifest injected, is written to
  10. * disk at `swDest`.
  11. *
  12. * This method will not compile or bundle your `swSrc` file; it just handles
  13. * injecting the manifest.
  14. *
  15. * ```
  16. * // The following lists some common options; see the rest of the documentation
  17. * // for the full set of options and defaults.
  18. * const {count, size, warnings} = await injectManifest({
  19. * dontCacheBustURLsMatching: [new RegExp('...')],
  20. * globDirectory: '...',
  21. * globPatterns: ['...', '...'],
  22. * maximumFileSizeToCacheInBytes: ...,
  23. * swDest: '...',
  24. * swSrc: '...',
  25. * });
  26. * ```
  27. *
  28. * @memberof workbox-build
  29. */
  30. export declare function injectManifest(config: InjectManifestOptions): Promise<BuildResult>;