Rename remaining occurrences of webpacker to shakapacker

This commit is contained in:
Sebastian Serth
2023-09-01 19:39:51 +02:00
parent 07201e7a29
commit ac92385dd7
5 changed files with 10 additions and 11 deletions

View File

@@ -0,0 +1,29 @@
# frozen_string_literal: true
module Shakapacker::SriHelperExtensions
def stylesheet_link_tag(*sources, **options)
tags = sources.map do |stylesheet|
if stylesheet.is_a?(Hash)
super(stylesheet[:src], options.merge(integrity: stylesheet[:integrity]))
else
super(stylesheet, options)
end
end
safe_join(tags)
end
def javascript_include_tag(*sources, **options)
tags = sources.map do |javascript|
if javascript.is_a?(Hash)
super(javascript[:src], options.merge(integrity: javascript[:integrity]))
else
super(javascript, options)
end
end
safe_join(tags)
end
end
if Sprockets::Rails::Helper.ancestors.map(&:name).exclude?(Shakapacker::SriHelperExtensions.name)
Sprockets::Rails::Helper.prepend(Shakapacker::SriHelperExtensions)
end