get-sourcemap-asset-name.d.ts 967 B

1234567891011121314151617181920
  1. import type { Compilation } from 'webpack';
  2. /**
  3. * If our bundled swDest file contains a sourcemap, we would invalidate that
  4. * mapping if we just replaced injectionPoint with the stringified manifest.
  5. * Instead, we need to update the swDest contents as well as the sourcemap
  6. * at the same time.
  7. *
  8. * See https://github.com/GoogleChrome/workbox/issues/2235
  9. *
  10. * @param {Object} compilation The current webpack compilation.
  11. * @param {string} swContents The contents of the swSrc file, which may or
  12. * may not include a valid sourcemap comment.
  13. * @param {string} swDest The configured swDest value.
  14. * @return {string|undefined} If the swContents contains a valid sourcemap
  15. * comment pointing to an asset present in the compilation, this will return the
  16. * name of that asset. Otherwise, it will return undefined.
  17. *
  18. * @private
  19. */
  20. export declare function getSourcemapAssetName(compilation: Compilation, swContents: string, swDest: string): string | undefined;