2020-11-06 10:56:31 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Webpacker::ManifestExtensions
|
|
|
|
def lookup(name, pack_type = {})
|
|
|
|
asset = super
|
|
|
|
|
|
|
|
if pack_type[:with_integrity] && asset.respond_to?(:dig)
|
2024-04-15 10:15:32 +01:00
|
|
|
[asset['src'], asset['integrity']]
|
2020-11-06 10:56:31 +00:00
|
|
|
elsif asset.respond_to?(:dig)
|
2024-04-15 10:15:32 +01:00
|
|
|
asset['src']
|
2020-11-06 10:56:31 +00:00
|
|
|
else
|
|
|
|
asset
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Webpacker::Manifest.prepend(Webpacker::ManifestExtensions)
|