Files
ttrpg-tools/src/main.tsx
T
hypercross f33761e24f refactor(markdown): Make module CLI-importable
Drop the mermaid import from the markdown module. The extension only emits <pre class="mermaid">, so initialize mermaid in the app entry instead. Use explicit .js specifiers plus a bundler extensionAlias so both the NodeNext CLI build and the web build resolve the sources.
2026-09-12 16:38:03 +08:00

24 lines
573 B
TypeScript

import { render } from "solid-js/web";
import { Router, Route } from "@solidjs/router";
import mermaid from "mermaid";
import App from "./App";
import "./styles.css";
// Mermaid is a runtime concern; the markdown module only emits
// <pre class="mermaid"> placeholders. Initialize before any `mermaid.run()`.
mermaid.initialize({ theme: "dark" });
const root = document.getElementById("root");
if (root) {
render(
() => (
<Router>
<Route path="/" component={App} />
<Route path="/*" component={App} />
</Router>
),
root,
);
}