Skip to content

Commit

Permalink
fix(md-enhance): fix mermaid not working with pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Feb 27, 2023
1 parent 8813389 commit 21e6bfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/md-enhance/src/client/components/Mermaid.ts
Expand Up @@ -98,7 +98,9 @@ export default defineComponent({

const renderMermaid = async (): Promise<void> =>
Promise.all([
import(/* webpackChunkName: "mermaid" */ "mermaid"),
import(
/* webpackChunkName: "mermaid" */ "mermaid/dist/mermaid.esm.min.mjs"
),
new Promise((resolve) => setTimeout(resolve, MARKDOWN_ENHANCE_DELAY)),
]).then(async ([{ default: mermaid }]) => {
const chartOptions = { useMaxWidth: false };
Expand Down
2 changes: 1 addition & 1 deletion packages/md-enhance/src/shims-mermaid.d.ts
@@ -1,5 +1,5 @@
declare module "mermaid/dist/mermaid.esm.min.mjs" {
import Mermaid from "mermaid";

export default Mermaid.default;
export default Mermaid;
}

0 comments on commit 21e6bfe

Please sign in to comment.