Skip to content

Commit 3cf587a

Browse files
authored
Adding defer: true to javascript_include_tag
I'm adding defer: true to javascript_include_tag so that lit JS works even when we are using the "defer" prop on the main application.js include tag (which is usually importing jQuery). I don't see what harms that change could do, but please, let me know if it may break things.
1 parent 3b8db97 commit 3cf587a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/helpers/lit/frontend_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def missing_translation(key, options)
3939
prepend Lit::FrontendHelper::TranslationKeyWrapper
4040

4141
def javascript_lit_tag
42-
javascript_include_tag 'lit/lit_frontend'
42+
javascript_include_tag 'lit/lit_frontend', defer: true
4343
end
4444

4545
def stylesheet_lit_tag

0 commit comments

Comments
 (0)