import { mount } from "svelte"; import "./app.css"; import HomePage from "./routes/+page.svelte"; import HeartPage from "./routes/heart/+page.svelte"; const routes: Record = { "/": HomePage, "/heart": HeartPage, }; const normalizedPath = window.location.pathname.replace(/\/+$/, "") || "/"; const App = routes[normalizedPath] ?? HomePage; const app = mount(App, { target: document.getElementById("app")!, }); export default app;