@marko/vite 5.1.3 → 5.1.4

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.
Files changed (2) hide show
  1. package/dist/index.mjs +8 -6
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -651,16 +651,18 @@ 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
- html += \`<script class=marko-vite-preload async blocking=render type=module\${this.___viteInjectAttrs}>\`;
654
+ html += \`<script marko-vite-preload async blocking=render type=module\${this.___viteInjectAttrs}>\`;
655
+ html+= "await Promise.allSettled([";
656
+
655
657
  for (const id of preload) {
656
- html += \`import \${JSON.stringify(base + id)};\`;
658
+ html += \`import(\${JSON.stringify(base + id)}),\`;
657
659
  }
658
660
 
659
- html += "document.querySelectorAll('.marko-vite-preload').forEach((el) => el.remove());";
661
+ html += "]);";
660
662
  html += "document.documentElement.style.visibility='';";
661
- html +=
662
- "if(document.documentElement.getAttribute('style')==='')document.documentElement.removeAttribute('style');";
663
- html += \`</script><script class=marko-vite-preload\${this.___viteInjectAttrs}>document.documentElement.style.visibility='hidden'</script>\`;
663
+ html += "if(document.documentElement.getAttribute('style')==='')document.documentElement.removeAttribute('style');";
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>\`;
664
666
  }
665
667
  }`}
666
668
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/vite",
3
- "version": "5.1.3",
3
+ "version": "5.1.4",
4
4
  "description": "A Marko plugin for Vite",
5
5
  "keywords": [
6
6
  "loader",