Skip to content

Commit de18a9b

Browse files
rightonesijjk
andauthored
Check properly whether SWC is used or not when using forceSwcTransforms (vercel#42531)
Check whether SWC is used or not by checking "useSWCLoader" variable, not by checking "babelConfigFile". Since we can bypass babel config file by turning on experimental.forceSwcTransforms, we should not check babel by its config file. Co-authored-by: JJ Kasper <[email protected]>
1 parent af3c506 commit de18a9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: packages/next/build/webpack-config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export default async function getBaseWebpackConfig(
660660
loggedIgnoredCompilerOptions = true
661661
}
662662

663-
if (babelConfigFile && config.experimental.fontLoaders) {
663+
if (!useSWCLoader && babelConfigFile && config.experimental.fontLoaders) {
664664
Log.error(
665665
`"experimental.fontLoaders" is enabled which requires SWC although Babel is being used due to custom babel config being present "${path.relative(
666666
dir,

0 commit comments

Comments
 (0)