Fix polyfills naming and tag missing a source (#34768)
This commit is contained in:
parent
12c8a6498c
commit
ef1bf8e9f2
4 changed files with 8 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue