From 283440e1e749635f1ab0a2835aad833510a1be95 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Wed, 27 Nov 2024 19:48:56 +0100 Subject: [PATCH] fix: fix deleting .tsbuildinfo file (#706) After adding ESM support, the path for `.tsbuildinfo` changed, but the code still referred to the previous path. This fixes the code to use the correct path. --- .../src/targets/typescript.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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, [