fix browser events in export html

This commit is contained in:
Reimar 2025-10-15 09:48:22 +02:00
parent fa72e4b928
commit 01e5a5c7e8
2 changed files with 5 additions and 2 deletions

View File

@ -52,6 +52,8 @@ export class HtmlExporter {
const gamelib = new Gamelib(console, new AssetProvider(), document.querySelector('canvas'));
gamelib.init();
window.karlkoder = {
lib() {
return gamelib.getAdapter();
@ -65,7 +67,8 @@ ${js}
<body>
<canvas width="480" height="360"></canvas>
</body>
</html>`;
</html>
`.trim();
return html;
}

View File

@ -28,7 +28,7 @@ export function minifyJs(code) {
.map((line) =>
line
.replace(/\/\/.+$/, "")
.replace(/\) \{/, "){")
.replace(/\) \{\n/, "){")
.replace(/ = /g, "=")
.trim()
)