@marko/vite 4.1.13 → 4.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +6 -12
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -53,22 +53,16 @@ function renderAssets(slot) {
|
|
|
53
53
|
// To avoid FOUC we will hide the page until all of these modules are loaded.
|
|
54
54
|
const { preload } = entry;
|
|
55
55
|
if (preload) {
|
|
56
|
-
|
|
57
|
-
html += \`<script\${this.___viteInjectAttrs}>((root=document.documentElement)=>{\`;
|
|
58
|
-
html += "root.style.visibility='hidden';";
|
|
59
|
-
html += "document.currentScript.remove();";
|
|
60
|
-
html += "Promise.allSettled([";
|
|
61
|
-
|
|
56
|
+
html += \`<script class=marko-vite-preload blocking=render type=module\${this.___viteInjectAttrs}>\`;
|
|
62
57
|
for (const id of preload) {
|
|
63
|
-
html +=
|
|
64
|
-
sep = ",";
|
|
58
|
+
html += \`import \${JSON.stringify(base + id)};\`;
|
|
65
59
|
}
|
|
66
60
|
|
|
67
|
-
html += "
|
|
68
|
-
html += "
|
|
61
|
+
html += "document.querySelectorAll('.marko-vite-preload').forEach((el) => el.remove());";
|
|
62
|
+
html += "document.documentElement.style.visibility='';";
|
|
69
63
|
html +=
|
|
70
|
-
"if(
|
|
71
|
-
html += "
|
|
64
|
+
"if(document.documentElement.getAttribute('style')==='')document.documentElement.removeAttribute('style');";
|
|
65
|
+
html += "</script><script class=marko-vite-preload>document.documentElement.style.visibility='hidden'</script>";
|
|
72
66
|
}
|
|
73
67
|
}`}
|
|
74
68
|
|
package/package.json
CHANGED