feat(v2): preload first page load script asap (#2208)

Co-authored-by: Endi <endiliey@gmail.com>
This commit is contained in:
Yangshun Tay 2020-01-12 21:26:14 +08:00 committed by GitHub
parent a38125a718
commit 5e821fd4e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,6 +19,9 @@ module.exports = `
<% stylesheets.forEach((stylesheet) => { %>
<link rel="stylesheet" type="text/css" href="<%= baseUrl %><%= stylesheet %>" />
<% }); %>
<% scripts.forEach((script) => { %>
<link rel="preload" href="<%= baseUrl %><%= script %>" as="script">
<% }); %>
</head>
<body <%- bodyAttributes %>>
<%- preBodyTags %>