Skip to content

Commit

Permalink
Check properly whether SWC is used or not when using forceSwcTransfor…
Browse files Browse the repository at this point in the history
…ms (#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 <22380829+ijjk@users.noreply.github.com>
  • Loading branch information
rightones and ijjk committed Nov 7, 2022
1 parent af3c506 commit de18a9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/build/webpack-config.ts
Expand Up @@ -660,7 +660,7 @@ export default async function getBaseWebpackConfig(
loggedIgnoredCompilerOptions = true
}

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

0 comments on commit de18a9b

Please sign in to comment.