Only resolve package.json when relative configs are enabled (#13063)
This commit is contained in:
parent
8e8954b470
commit
06eb3b73cb
@ -201,17 +201,17 @@ export function* buildRootChain(
|
|||||||
mergeChain(configFileChain, result);
|
mergeChain(configFileChain, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pkgData =
|
|
||||||
typeof context.filename === "string"
|
|
||||||
? yield* findPackageData(context.filename)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
let ignoreFile, babelrcFile;
|
let ignoreFile, babelrcFile;
|
||||||
let isIgnored = false;
|
let isIgnored = false;
|
||||||
const fileChain = emptyChain();
|
const fileChain = emptyChain();
|
||||||
// resolve all .babelrc files
|
// resolve all .babelrc files
|
||||||
if (
|
if (
|
||||||
(babelrc === true || babelrc === undefined) &&
|
(babelrc === true || babelrc === undefined) &&
|
||||||
|
typeof context.filename === "string"
|
||||||
|
) {
|
||||||
|
const pkgData = yield* findPackageData(context.filename);
|
||||||
|
|
||||||
|
if (
|
||||||
pkgData &&
|
pkgData &&
|
||||||
babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)
|
babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)
|
||||||
) {
|
) {
|
||||||
@ -253,6 +253,7 @@ export function* buildRootChain(
|
|||||||
fileChain.files.add(babelrcFile.filepath);
|
fileChain.files.add(babelrcFile.filepath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (context.showConfig) {
|
if (context.showConfig) {
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user