File tree Expand file tree Collapse file tree 2 files changed +21
-15
lines changed
Expand file tree Collapse file tree 2 files changed +21
-15
lines changed Original file line number Diff line number Diff line change 1- // components/Mermaid.tsx
2- 'use client' ;
1+ // // components/Mermaid.tsx
2+ // 'use client';
33
4- import { useEffect , useRef } from 'react' ;
5- import mermaid from 'mermaid' ;
4+ // import { useEffect, useRef } from 'react';
5+ // import mermaid from 'mermaid';
66
7- interface MermaidProps {
8- code : string ;
9- }
7+ // interface MermaidProps {
8+ // code: string;
9+ // }
1010
11- export default function Mermaid ( { code } : MermaidProps ) {
12- const ref = useRef < HTMLDivElement > ( null ) ;
11+ // export default function Mermaid({ code }: MermaidProps) {
12+ // const ref = useRef<HTMLDivElement>(null);
1313
14- useEffect ( ( ) => {
15- mermaid . initialize ( { startOnLoad : true } ) ;
16- mermaid . contentLoaded ( ) ;
17- } , [ code ] ) ;
14+ // useEffect(() => {
15+ // mermaid.initialize({ startOnLoad: true });
16+ // mermaid.contentLoaded();
17+ // }, [code]);
1818
19- return < div className = "mermaid" ref = { ref } > { code } </ div > ;
20- }
19+ // return <div className="mermaid" ref={ref}>{code}</div>;
20+ // }
Original file line number Diff line number Diff line change @@ -102,6 +102,12 @@ module.exports = withBundleAnalyzer({
102102 'react-dom/test-utils' : 'preact/test-utils' ,
103103 'react-dom' : 'preact/compat' ,
104104 } ) ;
105+
106+ config . entry = {
107+ myCustomScript1 : 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js' ,
108+ //myCustomScript2: './static/init.js',
109+ } ;
110+
105111 }
106112
107113 return config ;
You can’t perform that action at this time.
0 commit comments