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
+7
View File
@@ -18,6 +18,13 @@ export default defineConfig({
},
},
rspack: {
resolve: {
// Allow TypeScript sources to use explicit `.js` specifiers (required
// by the CLI's NodeNext build) while the bundler resolves them to .ts.
extensionAlias: {
".js": [".ts", ".tsx", ".js"],
},
},
module: {
rules: [
{