From 9d8a4924fc29054274256ed8a5c01ed90c1f650f Mon Sep 17 00:00:00 2001 From: Dale Bustad Date: Wed, 14 Apr 2021 15:28:22 -0700 Subject: [PATCH] Change `hasBabelRc` to `babelrc` to make old loader happy. --- packages/next/build/babel/loader/get-config.ts | 4 ++-- packages/next/build/babel/loader/types.d.ts | 2 +- packages/next/build/webpack-config.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/next/build/babel/loader/get-config.ts b/packages/next/build/babel/loader/get-config.ts index bfb39fce73c4b..a3db3550ce767 100644 --- a/packages/next/build/babel/loader/get-config.ts +++ b/packages/next/build/babel/loader/get-config.ts @@ -153,12 +153,12 @@ function getFreshConfig( development, hasReactRefresh, hasJsxRuntime, - hasBabelRc, + babelrc, } = loaderOptions const nextPresetItem = createConfigItem(nextBabelPreset, { type: 'preset' }) let options = { - babelrc: hasBabelRc, + babelrc, cloneInputAst: false, filename, inputSourceMap: inputSourceMap || undefined, diff --git a/packages/next/build/babel/loader/types.d.ts b/packages/next/build/babel/loader/types.d.ts index 4417e6de0dfbc..6eec4d0ed412a 100644 --- a/packages/next/build/babel/loader/types.d.ts +++ b/packages/next/build/babel/loader/types.d.ts @@ -15,5 +15,5 @@ export interface NextBabelLoaderOptions { sourceMaps?: any[] overrides: any caller: any - hasBabelRc: boolean + babelrc: boolean } diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 9c659f881c994..39376ef9fd297 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -234,7 +234,7 @@ export default async function getBaseWebpackConfig( // fixed in rc.1. semver.gte(reactVersion!, '17.0.0-rc.1') - const hasBabelRc = await ['.babelrc', '.babelrc.json'].reduce( + const babelrc = await ['.babelrc', '.babelrc.json'].reduce( async (memo: boolean | Promise, filename) => { return (await memo) || (await fileExists(path.join(dir, filename))) }, @@ -250,7 +250,7 @@ export default async function getBaseWebpackConfig( babel: { loader: babelLoader, options: { - hasBabelRc, + babelrc, isServer, distDir, pagesDir,