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.
This commit is contained in:
2026-09-12 16:38:03 +08:00
parent d6ea385a26
commit f33761e24f
5 changed files with 18 additions and 11 deletions
+5
View File
@@ -1,8 +1,13 @@
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) {