Skip to content

Commit 057a396

Browse files
committed
Always treat JS bundles as modules
1 parent f8ad806 commit 057a396

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/presenters/cms_rendering_context.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def liquid_assigns_for_single_page_app(cms_layout)
129129
def liquid_assigns_for_placeholder_template
130130
styles_url = url_with_possible_host("/packs/application-styles.js", ENV.fetch("ASSETS_HOST", nil))
131131
liquid_assigns.merge(
132-
"content_for_head" => "#{javascript_include_tag styles_url}{{ content_for_head }}",
132+
"content_for_head" => "#{javascript_include_tag styles_url, type: "module"}{{ content_for_head }}",
133133
"content_for_navbar" => "{{ content_for_navbar }}",
134134
"content_for_layout" => "{{ content_for_layout }}"
135135
)

app/views/layouts/graphiql.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<title>GraphiQL</title>
55
<%= stylesheet_link_tag url_with_possible_host('/packs/dev-mode-graphiql.css', ENV['ASSETS_HOST']), media: :all %>
6-
<%= javascript_include_tag url_with_possible_host('/packs/dev-mode-graphiql.js', ENV['ASSETS_HOST']), defer: true %>
6+
<%= javascript_include_tag url_with_possible_host('/packs/dev-mode-graphiql.js', ENV['ASSETS_HOST']), type: 'module', defer: true %>
77
</head>
88
<body>
99
<%= yield %>

0 commit comments

Comments
 (0)