Skip to content

Commit

Permalink
perf(core): move scripts to document head + defer (#8081)
Browse files Browse the repository at this point in the history
Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
  • Loading branch information
sanjaiyan-dev and slorber authored Oct 13, 2022
1 parent 2372335 commit 80064b2
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ export default `
<link rel="stylesheet" href="<%= it.baseUrl %><%= stylesheet %>" />
<% }); %>
<% it.scripts.forEach((script) => { %>
<link rel="preload" href="<%= it.baseUrl %><%= script %>" as="script">
<script src="<%= it.baseUrl %><%= script %>" defer></script>
<% }); %>
</head>
<body <%~ it.bodyAttributes %>>
<%~ it.preBodyTags %>
<div id="__docusaurus">
<%~ it.appHtml %>
</div>
<% it.scripts.forEach((script) => { %>
<script src="<%= it.baseUrl %><%= script %>"></script>
<% }); %>
<%~ it.postBodyTags %>
</body>
</html>
Expand Down

0 comments on commit 80064b2

Please sign in to comment.