@marko/vite 5.1.4 → 5.1.5
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 +7 -6
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -651,18 +651,19 @@ function renderAssets(slot) {
|
|
|
651
651
|
// To avoid FOUC we will hide the page until all of these modules are loaded.
|
|
652
652
|
const { preload } = entry;
|
|
653
653
|
if (preload) {
|
|
654
|
+
let sep = "";
|
|
655
|
+
html += \`<style marko-vite-preload\${this.___viteInjectAttrs}>html{visibility:hidden !important}</style>\`;
|
|
654
656
|
html += \`<script marko-vite-preload async blocking=render type=module\${this.___viteInjectAttrs}>\`;
|
|
655
|
-
html+= "await Promise.allSettled([";
|
|
657
|
+
html += "await Promise.allSettled([";
|
|
656
658
|
|
|
657
659
|
for (const id of preload) {
|
|
658
|
-
html += \`import(\${JSON.stringify(base + id)})
|
|
660
|
+
html += sep + \`import(\${JSON.stringify(base + id)})\`;
|
|
661
|
+
sep = ",";
|
|
659
662
|
}
|
|
660
663
|
|
|
661
664
|
html += "]);";
|
|
662
|
-
html += "document.
|
|
663
|
-
html +=
|
|
664
|
-
html += "document.querySelectorAll('[marko-vite-preload]').forEach((el) => el.remove());";
|
|
665
|
-
html += \`</script><script marko-vite-preload\${this.___viteInjectAttrs}>document.documentElement.style.visibility='hidden'</script>\`;
|
|
665
|
+
html += "document.querySelectorAll('[marko-vite-preload]').forEach(el=>el.remove());";
|
|
666
|
+
html += \`</script>\`;
|
|
666
667
|
}
|
|
667
668
|
}`}
|
|
668
669
|
|