You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
388 B

  1. # frozen_string_literal: true
  2. module Webpacker::ManifestExtensions
  3. def lookup(name, pack_type = {})
  4. asset = super
  5. if pack_type[:with_integrity] && asset.respond_to?(:dig)
  6. [asset.dig('src'), asset.dig('integrity')]
  7. elsif asset.respond_to?(:dig)
  8. asset.dig('src')
  9. else
  10. asset
  11. end
  12. end
  13. end
  14. Webpacker::Manifest.prepend(Webpacker::ManifestExtensions)