mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Load css async
This commit is contained in:
26
gulp/html.js
26
gulp/html.js
@@ -54,19 +54,19 @@ function gulptasksHTML($, gulp, buildFolder) {
|
||||
document.head.appendChild(css);
|
||||
|
||||
// Append async css
|
||||
const asyncCss = document.createElement("link");
|
||||
asyncCss.rel = "stylesheet";
|
||||
asyncCss.type = "text/css";
|
||||
asyncCss.media = "none";
|
||||
asyncCss.setAttribute("onload", "this.media='all'");
|
||||
asyncCss.href = cachebust("async-resources.css");
|
||||
if (integrity) {
|
||||
asyncCss.setAttribute(
|
||||
"integrity",
|
||||
computeIntegrityHash(path.join(buildFolder, "async-resources.css"))
|
||||
);
|
||||
}
|
||||
document.head.appendChild(asyncCss);
|
||||
// const asyncCss = document.createElement("link");
|
||||
// asyncCss.rel = "stylesheet";
|
||||
// asyncCss.type = "text/css";
|
||||
// asyncCss.media = "none";
|
||||
// asyncCss.setAttribute("onload", "this.media='all'");
|
||||
// asyncCss.href = cachebust("async-resources.css");
|
||||
// if (integrity) {
|
||||
// asyncCss.setAttribute(
|
||||
// "integrity",
|
||||
// computeIntegrityHash(path.join(buildFolder, "async-resources.css"))
|
||||
// );
|
||||
// }
|
||||
// document.head.appendChild(asyncCss);
|
||||
|
||||
if (app) {
|
||||
// Append cordova link
|
||||
|
||||
Reference in New Issue
Block a user