From 965a280bc2b74a704cecb3098f3be084eba5f15e Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Thu, 12 Aug 2021 16:33:25 +0200 Subject: [PATCH] Ensure config file message is only shown once (#28017) Fixes #27982 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes --- packages/next/build/babel/loader/get-config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/next/build/babel/loader/get-config.ts b/packages/next/build/babel/loader/get-config.ts index 5c4855d055e789c..c0d80a805b468f2 100644 --- a/packages/next/build/babel/loader/get-config.ts +++ b/packages/next/build/babel/loader/get-config.ts @@ -302,6 +302,7 @@ function getCacheKey(cacheCharacteristics: CharacteristicsGermaneToCaching) { type BabelConfig = any const configCache: Map = new Map() +const configFiles: Set = new Set() export default function getConfig( this: NextJsLoaderContext, @@ -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}` )