Skip to content

Commit

Permalink
Dev server: add placeholder while bundling application
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Oct 28, 2019
1 parent 8dc4c9d commit 04e4819
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/dev-build-html.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ export default indexFile =>
return scriptTag;
})
);
const removeDialogScript = document.createElement("script");
const dialog = document.createElement("dialog");
dialog.open = true;
dialog.id = "placeholder-dialog";
dialog.append(
document.createElement("progress"),
" Building application..."
);
removeDialogScript.textContent = `import("./${BUNDLE_NAME}").then(()=>document.getElementById("${dialog.id}").remove())`;
document.body.append(dialog, removeDialogScript);
return dom.serialize();
}
);

0 comments on commit 04e4819

Please sign in to comment.