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
  • Loading branch information
JReinhold authored Apr 15, 2024
2 parents e967840 + 6fdb569 commit d1b4753
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 d1b4753

Please sign in to comment.