Fix font preloading causing errors on non-root deployments (#22714)

This commit is contained in:
Michael Telatynski 2022-07-01 20:05:43 +01:00 committed by GitHub
parent 0baca38c31
commit 53ce8388f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,8 +52,8 @@
<% for (var i=0; i < htmlWebpackPlugin.tags.headTags.length; i++) {
var tag = htmlWebpackPlugin.tags.headTags[i];
var path = tag.attributes && tag.attributes.href;
if (path.indexOf("Inter") !== -1) { %>
<link rel="preload" as="font" href="<%= path %>" crossorigin="anonymous"/>
if (path.includes("/Inter/")) { %>
<link rel="preload" as="font" href=".<%= path %>" crossorigin="anonymous"/>
<% }
} %>