Skip to content

Commit f436199

Browse files
Add text to call the main function
1 parent 84f9908 commit f436199

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

client/public/frame.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
66
<meta content="utf-8" http-equiv="encoding">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
<script noshim>
8+
<script>
99
window.esmsInitOptions = {
1010
// -- Hooks --
1111
// Module load error
@@ -55,7 +55,7 @@
5555
<link rel="modulepreload" href="https://ga.jspm.io/npm:[email protected]/index.js" integrity="sha384-jVagjV+2YtlseazU2byX6gMLPHaA5Ps2c6HhvsGDlWjn45YCCoU1q+QtQTOb1MjT"/>
5656
<link rel="modulepreload" href="https://ga.jspm.io/npm:[email protected]/index.js" integrity="sha384-HIW1B3OQdGPkUEgh29MiYoUKQp+mFTjw50hRVvGhZgUaNYrUFYN07a+3CqC0/I7L"/>
5757
<link rel="modulepreload" href="https://ga.jspm.io/npm:[email protected]/dist/esm-browser/index.js" integrity="sha384-y7UmGnwe+/V/S4AD5T6MLU9dHjA3PLvuVGNhrqZApiNbq9Lf8s3aNRrcnzOa+qtR"/>
58-
<script src="js/frame.js" crossorigin="anonymous" noshim></script>
58+
<script src="js/frame.js"></script>
5959
</head>
6060
<body>
6161
<main id="main"></main>

client/public/js/frame.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
.split("\n")
1414
.map((line) => line.replace(/^import (.+) from "..\/([^"]+)";$/, `import $1 from "${url}/$2";`))
1515
.join("\n");
16+
const finalCode = codeFixedImports + "\n\nmain();"
1617
// See https://stackoverflow.com/a/6433770
1718
try {
18-
scriptEl.appendChild(document.createTextNode(codeFixedImports));
19+
scriptEl.appendChild(document.createTextNode(finalCode));
1920
} catch (e) {
20-
scriptEl.text = codeFixedImports;
21+
scriptEl.text = finalCode;
2122
} finally {
2223
document.body.appendChild(scriptEl);
2324
}

0 commit comments

Comments
 (0)