Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(core): move scripts to document head + defer #8081

Merged
merged 10 commits into from
Oct 13, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,18 @@ export default `
<% }); %>
<%~ it.headTags %>
<% it.stylesheets.forEach((stylesheet) => { %>
<link rel="preload" href="<%= it.baseUrl %><%= stylesheet %>" as="style" />
<link rel="stylesheet" href="<%= it.baseUrl %><%= stylesheet %>" />
sanjaiyan-dev marked this conversation as resolved.
Show resolved Hide resolved
<% }); %>
<% 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>
<% }); %>
sanjaiyan-dev marked this conversation as resolved.
Show resolved Hide resolved
<%~ it.postBodyTags %>
</body>
</html>
Expand Down