Skip to content

Commit bde5fa8

Browse files
author
Ives van Hoorne
committed
Fix loading of external resources after dependencies
1 parent 4c81b8b commit bde5fa8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/sandbox/external-resources.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function addCSS(resource: string) {
2727
function addJS(resource: string) {
2828
const script = document.createElement('script');
2929
script.setAttribute('src', resource);
30+
script.setAttribute('async', false);
3031
script.setAttribute('id', 'external-js');
3132
document.head.appendChild(script);
3233
}

src/sandbox/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ async function compile(message) {
6060
if (url == null || url !== newUrl) {
6161
fetching = true;
6262
url = newUrl;
63+
handleExternalResources(externalResources);
6364
await addDependencyBundle();
6465
fetching = false;
6566
window.parent.postMessage('Ready!', host);
6667
return;
6768
}
68-
handleExternalResources(externalResources);
6969

7070
try {
7171
const html = getIndexHtml(modules);

0 commit comments

Comments
 (0)