Skip to content

Commit add7678

Browse files
committed
fix: check if codegen config is present before skipping compilation
1 parent 7d8077a commit add7678

File tree

1 file changed

+4
-2
lines changed
  • packages/react-native-builder-bob/src/utils

1 file changed

+4
-2
lines changed

packages/react-native-builder-bob/src/utils/compile.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ export default async function compile({
108108

109109
// If codegen is used in the app, then we need to preserve TypeScript source
110110
// So we copy the file as is instead of transforming it
111-
if (isCodegenSpec(filepath)) {
111+
const codegenEnabled = 'codegenConfig' in pkg;
112+
113+
if (codegenEnabled && isCodegenSpec(filepath)) {
112114
fs.copy(filepath, path.join(output, path.relative(source, filepath)));
113115
return;
114116
}
@@ -123,7 +125,7 @@ export default async function compile({
123125
: false,
124126
rewriteImportExtensions: esm,
125127
jsxRuntime,
126-
codegenEnabled: 'codegenConfig' in pkg,
128+
codegenEnabled,
127129
},
128130
cwd: root,
129131
babelrc: babelrc,

0 commit comments

Comments
 (0)