Skip to content

Commit

Permalink
[compiler:babel] Don't read config files when not running as part of
Browse files Browse the repository at this point in the history
user's pipeline

When the user app has a babel.config file that is missing the compiler,
strange things happen as babel does some strange merging of options from
the user's config and in various callsites like in our eslint rule and
healthcheck script. To minimize odd behavior, we default to not reading
the user's babel.config

Fixes #29135

ghstack-source-id: 92b193508e7ce2951e487757b3bcad0a273f9e26
Pull Request resolved: #29211
  • Loading branch information
poteto committed May 22, 2024
1 parent 24050d2 commit 33bfeb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function runBabelPluginReactCompiler(
"babel-plugin-fbt-runtime",
],
sourceType: "module",
configFile: false,
});
invariant(
result?.code != null,
Expand Down
5 changes: 4 additions & 1 deletion scripts/jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ module.exports = {
sourceAst,
src,
Object.assign(
{filename: path.relative(process.cwd(), filePath)},
{
filename: path.relative(process.cwd(), filePath),
configFile: false,
},
babelOptions,
{
plugins,
Expand Down

0 comments on commit 33bfeb0

Please sign in to comment.