Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[compiler:babel] Don't read config files when not running as part of #29211

Merged
merged 9 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export function runBabelPluginReactCompiler(
"babel-plugin-fbt-runtime",
],
sourceType: "module",
configFile: false,
poteto marked this conversation as resolved.
Show resolved Hide resolved
babelrc: false,
});
invariant(
result?.code != null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ const rule: Rule.RuleModule = {
[BabelPluginReactCompiler, options],
],
sourceType: "module",
configFile: false,
babelrc: false,
});
} catch (err) {
if (isReactCompilerError(err) && Array.isArray(err.details)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ function runBabelPluginReactCompiler(
retainLines: true,
plugins: [[BabelPluginReactCompiler, options]],
sourceType: "module",
configFile: false,
babelrc: false,
});
if (result?.code == null) {
throw new Error(
Expand Down
6 changes: 6 additions & 0 deletions compiler/packages/snap/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ export async function transformFixtureInput(
sourceType: "module",
ast: includeEvaluator,
cloneInputAst: includeEvaluator,
configFile: false,
babelrc: false,
});
invariant(
forgetResult?.code != null,
Expand All @@ -355,6 +357,8 @@ export async function transformFixtureInput(
const result = transformFromAstSync(forgetResult.ast, forgetOutput, {
presets,
filename: virtualFilepath,
configFile: false,
babelrc: false,
});
if (result?.code == null) {
return {
Expand All @@ -379,6 +383,8 @@ export async function transformFixtureInput(
const result = transformFromAstSync(inputAst, input, {
presets,
filename: virtualFilepath,
configFile: false,
babelrc: false,
});

if (result?.code == null) {
Expand Down