From 0ff3def80cf96d92d6db2e2139bf6bf65773218a Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 26 Sep 2025 16:16:26 +0200 Subject: [PATCH] Fix Rspack/SWC mermaid ELK layout dependency required bug --- packages/docusaurus-theme-mermaid/src/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/docusaurus-theme-mermaid/src/index.ts b/packages/docusaurus-theme-mermaid/src/index.ts index 622c6b2ef72b..288000902be4 100644 --- a/packages/docusaurus-theme-mermaid/src/index.ts +++ b/packages/docusaurus-theme-mermaid/src/index.ts @@ -49,6 +49,18 @@ export default async function themeMermaid(): Promise> { ), }), ], + + // Workaround for weird Rspack/SWC issue + // See https://github.com/facebook/docusaurus/issues/11430 + resolve: { + alias: { + ...(elkLayoutEnabled + ? {} + : { + '@mermaid-js/layout-elk': false, + }), + }, + }, }; }, };