1
0
Fork 0
forked from gitea/nas

Fix JS polyfills missing after the Vite switch (#34758)

This commit is contained in:
Renaud Chaput 2025-05-21 22:11:01 +02:00 committed by GitHub
parent 6ab96ba647
commit 83dd09d4dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 59 additions and 4 deletions

View file

@ -119,6 +119,12 @@ module ViteRails::TagHelpers::IntegrityExtension
rescue ViteRuby::MissingEntrypointError
# 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)
javascript_include_tag(type: 'module', src: entry[:path], integrity: entry[:integrity], **)
end
end
ViteRails::TagHelpers.prepend ViteRails::TagHelpers::IntegrityExtension