import { render } from "solid-js/web";
import "../styles/app.css";
import HostApp from "./app";

const root = document.getElementById("app");
if (!root) throw new Error("missing #app root");
render(() => <HostApp />, root);

if (import.meta.env.PROD && "serviceWorker" in navigator) {
  window.addEventListener("load", () => {
    void navigator.serviceWorker.register("/sw.js");
  });
}
