diff --git a/packages/react-native-builder-bob/src/targets/typescript.ts b/packages/react-native-builder-bob/src/targets/typescript.ts index b333ab12d..2d6189cd3 100644 --- a/packages/react-native-builder-bob/src/targets/typescript.ts +++ b/packages/react-native-builder-bob/src/targets/typescript.ts @@ -156,8 +156,15 @@ export default async function build({ ); } + const outputs = options?.esm + ? { + commonjs: path.join(output, 'commonjs'), + module: path.join(output, 'module'), + } + : { commonjs: output }; + const tsbuildinfo = path.join( - output, + outputs.commonjs, project.replace(/\.json$/, '.tsbuildinfo') ); @@ -167,13 +174,6 @@ export default async function build({ // Ignore } - const outputs = options?.esm - ? { - commonjs: path.join(output, 'commonjs'), - module: path.join(output, 'module'), - } - : { commonjs: output }; - const result = spawn.sync( tsc, [