From 1ae87115a0972fd07a995b78271b3bba1638dcb5 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 19 Jan 2024 15:25:07 +0100 Subject: [PATCH] Next.js: Run in SWC mode when conditions fit --- code/frameworks/nextjs/src/preset.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/frameworks/nextjs/src/preset.ts b/code/frameworks/nextjs/src/preset.ts index 4f54465d5c8a..24b2c3ee46d9 100644 --- a/code/frameworks/nextjs/src/preset.ts +++ b/code/frameworks/nextjs/src/preset.ts @@ -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);