fix: load mermaid as normal now that inline is safely below bundle size
This commit is contained in:
parent
9e3e711646
commit
b00198b888
3 changed files with 22 additions and 19 deletions
|
@ -9,9 +9,6 @@ import { visit } from "unist-util-visit"
|
|||
import { Root, Element, ElementContent } from "hast"
|
||||
import { GlobalConfiguration } from "../cfg"
|
||||
import { i18n } from "../i18n"
|
||||
// @ts-ignore
|
||||
import mermaidScript from "./scripts/mermaid.inline"
|
||||
import mermaidStyle from "./styles/mermaid.inline.scss"
|
||||
import { QuartzPluginData } from "../plugins/vfile"
|
||||
|
||||
interface RenderComponents {
|
||||
|
@ -65,17 +62,6 @@ export function pageResources(
|
|||
contentType: "external",
|
||||
})
|
||||
|
||||
// dynamic afterDOMReady must come after postscript.js
|
||||
if (fileData.hasMermaidDiagram) {
|
||||
resources.js.push({
|
||||
script: mermaidScript,
|
||||
loadTime: "afterDOMReady",
|
||||
moduleType: "module",
|
||||
contentType: "inline",
|
||||
})
|
||||
resources.css.push({ content: mermaidStyle, inline: true })
|
||||
}
|
||||
|
||||
return resources
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue