Fix polyfills naming and tag missing a source (#34768)

This commit is contained in:
Renaud Chaput authored and GitHub committed 2025-05-22 12:54:47 +00:00
1 parent 12c8a6498c
commit ef1bf8e9f2
4 files changed
+8 -6

No files matched your search

+5 -3
View File
@@ -120,10 +120,12 @@ module ViteRails::TagHelpers::IntegrityExtension
# Ignore this error, it is not critical if the file is not preloaded
end
def vite_polyfill_tag(**)
entry = vite_manifest.path_and_integrity_for('polyfill', type: :virtual)
def vite_polyfills_tag(crossorigin: 'anonymous', **)
return if ViteRuby.instance.dev_server_running?
javascript_include_tag(type: 'module', src: entry[:path], integrity: entry[:integrity], **)
entry = vite_manifest.path_and_integrity_for('polyfills', type: :virtual)
javascript_include_tag(entry[:path], type: 'module', integrity: entry[:integrity], crossorigin: crossorigin, **)
end
end