Skip to content

Commit

Permalink
Ensure config file message is only shown once
Browse files Browse the repository at this point in the history
Fixes #27982
  • Loading branch information
timneutkens committed Aug 12, 2021
1 parent b2c7b31 commit de2c342
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/next/build/babel/loader/get-config.ts
Expand Up @@ -302,6 +302,7 @@ function getCacheKey(cacheCharacteristics: CharacteristicsGermaneToCaching) {

type BabelConfig = any
const configCache: Map<any, BabelConfig> = new Map()
const configFiles: Set<string> = new Set()

export default function getConfig(
this: NextJsLoaderContext,
Expand Down Expand Up @@ -346,7 +347,8 @@ export default function getConfig(
}
}

if (loaderOptions.configFile) {
if (loaderOptions.configFile && !configFiles.has(loaderOptions.configFile)) {
configFiles.add(loaderOptions.configFile)
Log.info(
`Using external babel configuration from ${loaderOptions.configFile}`
)
Expand Down

0 comments on commit de2c342

Please sign in to comment.