Skip to content

Commit

Permalink
Merge pull request #20335 from storybookjs/vite/swc-react
Browse files Browse the repository at this point in the history
Vite: Detect React SWC plugin
  • Loading branch information
ndelangen authored Dec 20, 2022
2 parents 02a4969 + 07f8f82 commit b48942e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/frameworks/react-vite/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets
const { plugins = [] } = config;

// Add react plugin if not present
if (!(await hasVitePlugins(plugins, ['vite:react-babel']))) {
if (!(await hasVitePlugins(plugins, ['vite:react-babel', 'vite:react-swc']))) {
const { default: react } = await import('@vitejs/plugin-react');
plugins.push(react());
}
Expand Down

0 comments on commit b48942e

Please sign in to comment.