Skip to content

Commit

Permalink
fix: use async script for paint holding
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Jul 22, 2024
1 parent 6c5ae4f commit dd83bcf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fair-zebras-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marko/vite": patch
---

Fix issue in dev mode where render blocking was lasting longer than necessary due to a deferred module script. The script is now marked as async.
2 changes: 1 addition & 1 deletion src/render-assets-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function renderAssets(slot) {
// To avoid FOUC we will hide the page until all of these modules are loaded.
const { preload } = entry;
if (preload) {
html += \`<script class=marko-vite-preload blocking=render type=module\${this.___viteInjectAttrs}>\`;
html += \`<script class=marko-vite-preload async blocking=render type=module\${this.___viteInjectAttrs}>\`;
for (const id of preload) {
html += \`import \${JSON.stringify(base + id)};\`;
}
Expand Down

0 comments on commit dd83bcf

Please sign in to comment.