11import type { App , Component , Plugin } from 'vue'
22import type { LanguageIconResolver } from './utils/languageIcon'
33import { setDefaultMathOptions } from 'stream-markdown-parser'
4+ import { defineAsyncComponent } from 'vue'
45import AdmonitionNode from './components/AdmonitionNode'
56
67import BlockquoteNode from './components/BlockquoteNode'
78import CheckboxNode from './components/CheckboxNode'
8- import CodeBlockNode from './components/CodeBlockNode'
99import DefinitionListNode from './components/DefinitionListNode'
1010import EmojiNode from './components/EmojiNode'
1111import FootnoteNode from './components/FootnoteNode'
@@ -20,8 +20,6 @@ import LinkNode from './components/LinkNode'
2020import ListItemNode from './components/ListItemNode'
2121import ListNode from './components/ListNode'
2222import MarkdownCodeBlockNode from './components/MarkdownCodeBlockNode'
23- import MathBlockNode from './components/MathBlockNode'
24- import MathInlineNode from './components/MathInlineNode'
2523import MermaidBlockNode from './components/MermaidBlockNode'
2624import MarkdownRender from './components/NodeRenderer'
2725import ParagraphNode from './components/ParagraphNode'
@@ -38,9 +36,14 @@ import { setDefaultI18nMap } from './composables/useSafeI18n'
3836import { setLanguageIconResolver } from './utils/languageIcon'
3937import { clearGlobalCustomComponents , getCustomNodeComponents , removeCustomComponents , setCustomComponents } from './utils/nodeComponents'
4038import './index.css'
39+ // Re-add top-level worker imports so builds emit worker bundles into `dist/`
4140import './workers/katexRenderer.worker?worker'
4241import './workers/mermaidParser.worker?worker'
4342
43+ const CodeBlockNode = defineAsyncComponent ( ( ) => import ( './components/CodeBlockNode' ) )
44+ const MathBlockNode = defineAsyncComponent ( ( ) => import ( './components/MathBlockNode' ) )
45+ const MathInlineNode = defineAsyncComponent ( ( ) => import ( './components/MathInlineNode' ) )
46+
4447// Export centralized props interfaces so they appear in package d.ts
4548export * from './utils'
4649
0 commit comments