From f904b24243495a33c5322783d4a556b3ac26dafd Mon Sep 17 00:00:00 2001 From: sunyiteng Date: Mon, 7 Sep 2026 17:15:36 +0800 Subject: [PATCH] fix: handle missing loader paths --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index d9b4c20..e745260 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,9 +40,10 @@ export const pluginMdx = (options: PluginMdxOptions = {}): RsbuildPlugin => ({ [CHAIN_ID.USE.SWC, CHAIN_ID.USE.BABEL].some((id) => { const use = jsRule.uses.get(id); + const loaderPath = use?.get('loader'); - if (use) { - mdxRule.use(id).loader(use.get('loader')).options(use.get('options')); + if (loaderPath) { + mdxRule.use(id).loader(loaderPath).options(use.get('options')); return true; }