2020-11-06 11:56:31 +01: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 11:15:32 +02:00
|
|
|
[asset['src'], asset['integrity']]
|
2020-11-06 11:56:31 +01:00
|
|
|
elsif asset.respond_to?(:dig)
|
2024-04-15 11:15:32 +02:00
|
|
|
asset['src']
|
2020-11-06 11:56:31 +01:00
|
|
|
else
|
|
|
|
asset
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Webpacker::Manifest.prepend(Webpacker::ManifestExtensions)
|