Hit compile first.
On compile, the JS output is posted to the iframe as {source: "monogate", type: "monogate:hot-swap", code} via postMessage. The game opts in by listening:
window.addEventListener("message", (ev) => {
if (ev.data?.source !== "monogate") return;
if (ev.data.type === "monogate:hot-swap") {
new Function(ev.data.code)(); // or eval into a sandboxed fn registry
}
});