Skip to content

Commit

Permalink
Change hasBabelRc to babelrc to make old loader happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
divmain committed Apr 14, 2021
1 parent 1830bea commit 9d8a492
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/next/build/babel/loader/get-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/babel/loader/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export interface NextBabelLoaderOptions {
sourceMaps?: any[]
overrides: any
caller: any
hasBabelRc: boolean
babelrc: boolean
}
4 changes: 2 additions & 2 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>, filename) => {
return (await memo) || (await fileExists(path.join(dir, filename)))
},
Expand All @@ -250,7 +250,7 @@ export default async function getBaseWebpackConfig(
babel: {
loader: babelLoader,
options: {
hasBabelRc,
babelrc,
isServer,
distDir,
pagesDir,
Expand Down

0 comments on commit 9d8a492

Please sign in to comment.