Process .babelignore before .babelrc (#7161)

This commit is contained in:
Logan Smyth 2018-01-05 20:39:36 -08:00 committed by GitHub
parent 1ded1d7ff6
commit bb17b72f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,14 +93,6 @@ export function buildRootChain(
// resolve all .babelrc files
if (opts.babelrc !== false && context.filename !== null) {
const filename = context.filename;
const babelrcFile = findBabelrc(filename, context.envName);
if (babelrcFile) {
const result = loadFileChain(babelrcFile, context);
if (!result) return null;
mergeChain(fileChain, result);
}
const babelignoreFile = findBabelignore(filename);
if (
babelignoreFile &&
@ -113,6 +105,14 @@ export function buildRootChain(
) {
return null;
}
const babelrcFile = findBabelrc(filename, context.envName);
if (babelrcFile) {
const result = loadFileChain(babelrcFile, context);
if (!result) return null;
mergeChain(fileChain, result);
}
}
// Insert file chain in front so programmatic options have priority