mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-12 04:31:11 +00:00
Avoid doing 2 lookups for a single stylesheet tag
This commit is contained in:
parent
8d69312230
commit
4a418bb017
|
@ -85,7 +85,11 @@ module ViteRails::TagHelpers::IntegrityExtension
|
|||
def vite_stylesheet_tag(*names, **options)
|
||||
''.html_safe.tap do |tags|
|
||||
names.each do |name|
|
||||
tags << super(name, integrity: vite_manifest.integrity_hash_for(name), **options)
|
||||
entry = vite_manifest.path_and_integrity_for(name, type: :stylesheet)
|
||||
|
||||
options[:extname] = false if Rails::VERSION::MAJOR >= 7
|
||||
|
||||
tags << stylesheet_link_tag(entry[:path], integrity: entry[:integrity], **options)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user