Skip to content

Commit

Permalink
Merge pull request #26837 from storybookjs/jeppe/24857-bug-mdx-compil…
Browse files Browse the repository at this point in the history
…ation-breaks-when-using-vitejsplugin-react-swc-and-extending-its-plugins

Addon-docs: Fix MDX compilation when using `@vitejs/plugin-react-swc` with plugins
(cherry picked from commit d1b4753)
  • Loading branch information
JReinhold authored and storybook-bot committed Apr 16, 2024
1 parent 10c43f2 commit fc2fb5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/addons/docs/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit fc2fb5f

Please sign in to comment.