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