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.
24 lines
573 B
TypeScript
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,
|
|
);
|
|
}
|