Skip to content

Commit c2b687a

Browse files
authored
Detect react compiler in expo project (#33)
1 parent 7f49833 commit c2b687a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-doctor/src/utils/discover-project.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const VITE_CONFIG_FILENAMES = [
4040
"vite.config.cjs",
4141
];
4242

43+
const EXPO_APP_CONFIG_FILENAMES = ["app.json", "app.config.js", "app.config.ts"];
44+
4345
const REACT_COMPILER_CONFIG_PATTERN = /react-compiler|reactCompiler/;
4446

4547
const FRAMEWORK_PACKAGES: Record<string, Framework> = {
@@ -307,6 +309,7 @@ const detectReactCompiler = (directory: string, packageJson: PackageJson): boole
307309
if (hasCompilerInConfigFiles(directory, NEXT_CONFIG_FILENAMES)) return true;
308310
if (hasCompilerInConfigFiles(directory, BABEL_CONFIG_FILENAMES)) return true;
309311
if (hasCompilerInConfigFiles(directory, VITE_CONFIG_FILENAMES)) return true;
312+
if (hasCompilerInConfigFiles(directory, EXPO_APP_CONFIG_FILENAMES)) return true;
310313

311314
let ancestorDirectory = path.dirname(directory);
312315
while (ancestorDirectory !== path.dirname(ancestorDirectory)) {

0 commit comments

Comments
 (0)