Skip to content

Commit

Permalink
Merge pull request #25670 from storybookjs/valentin/fix-nextjs-runnin…
Browse files Browse the repository at this point in the history
…g-in-swc-mode

Next.js: Fix SWC mode activation
  • Loading branch information
valentinpalkovic authored Jan 22, 2024
2 parents 424ad8f + 1ae8711 commit 0ace5a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/frameworks/nextjs/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (baseConfig,

const isNext14orNewer = semver.gte(nextjsVersion, '14.0.0');
const useSWC =
isNext14orNewer && (nextConfig.experimental?.forceSwcTransforms ?? !hasBabelConfig);
isNext14orNewer && (nextConfig.experimental?.forceSwcTransforms || !hasBabelConfig);

configureNextFont(baseConfig, useSWC);
configureRuntimeNextjsVersionResolution(baseConfig);
Expand Down

0 comments on commit 0ace5a5

Please sign in to comment.