Skip to content

Commit

Permalink
what if we just move the head scripts to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
thecristen committed Nov 22, 2024
1 parent 49c7e07 commit 6971085
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions lib/dotcom_web/templates/layout/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,8 @@

<link :if={dev_server?} rel="stylesheet" href={"#{webpack_path}/css/core.css"} />
<link :if={dev_server?} rel="stylesheet" href={"#{webpack_path}/css/app.css"} />
<script :if={dev_server?} defer src={"#{webpack_path}/core.js"}>
</script>
<script :if={dev_server?} defer src={"#{webpack_path}/app.js"}>
</script>

<link :if={!dev_server?} rel="stylesheet" href={static_url(@conn, "/css/core.css")} />
<link :if={!dev_server?} rel="stylesheet" href={static_url(@conn, "/css/app.css")} />
<script :if={!dev_server?} defer src={static_url(@conn, "/js/vendors.js")}>
</script>
<script :if={!dev_server?} defer src={static_url(@conn, "/js/app.js")}>
</script>
</head>
<%= content_tag(:body, class: Dotcom.BodyTag.class_name(@conn)) do %>
<div class="body-wrapper" id="body-wrapper">
Expand Down Expand Up @@ -114,14 +105,14 @@
<%= content_tag(:main, @inner_content, id: "main", tabindex: -1) %>
</div>
<%= render(__MODULE__, "_footer.html", conn: @conn) %>

<script :if={dev_server?} defer src={"#{webpack_path}/iewarning.js"}>
<script :if={!dev_server?} defer src={static_url(@conn, "/js/vendors.js")}>
</script>
<script :if={!dev_server?} defer src={static_url(@conn, "/js/app.js")}>
</script>
<script :if={!dev_server?} defer src={static_url(@conn, "/js/react.js")}>
<script :if={dev_server?} defer src={"#{webpack_path}/core.js"}>
</script>
<script :if={!dev_server?} defer src={static_url(@conn, "/js/iewarning.js")}>
<script :if={dev_server?} defer src={"#{webpack_path}/app.js"}>
</script>
<div id="ie-warning" class="c-ie-warning"></div>
</div>
<!-- Google Tag Manager (noscript) -->
<noscript :if={google_tag_manager_id()}>
Expand Down

0 comments on commit 6971085

Please sign in to comment.