From 6fdb569c02eabc595cfb48335098563e686d4857 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Sun, 14 Apr 2024 21:19:29 +0200 Subject: [PATCH] add mdx plugin to start of vite plugins instead of end --- code/addons/docs/src/preset.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index 31248e7af990..4b8811935ec9 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -166,7 +166,8 @@ export const viteFinal = async (config: any, options: Options) => { // add alias plugin early to ensure any other plugins that also add the aliases will override this // eg. the preact vite plugin adds its own aliases plugins.unshift(packageDeduplicationPlugin); - plugins.push(mdxPlugin(options)); + // mdx plugin needs to be before any react plugins + plugins.unshift(mdxPlugin(options)); return config; };