From 8fb1023a31d979e5eeb89845009adb840eaa060c Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Tue, 25 Jun 2024 09:32:18 -0700 Subject: [PATCH] Fix output path for generated artifacts Summary: This is a fix for https://github.com/facebook/react-native/issues/45112 This diff changes the codegen so that the output path is computed relative to project root (or `path` if provided) instead of current working directory. Changelog: [General][Fixed] - Codegen computes output path relative to project root instead of current working directory. Reviewed By: fkgozali Differential Revision: D59009821 --- .../react-native/scripts/codegen/generate-artifacts-executor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor.js b/packages/react-native/scripts/codegen/generate-artifacts-executor.js index df3c1e6ac0306d..074a397bf38ad2 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor.js @@ -365,7 +365,7 @@ function computeOutputPath(projectRoot, baseOutputPath, pkgJson, platform) { if (baseOutputPath == null) { const outputDirFromPkgJson = readOutputDirFromPkgJson(pkgJson, platform); if (outputDirFromPkgJson != null) { - baseOutputPath = outputDirFromPkgJson; + baseOutputPath = path.join(projectRoot, outputDirFromPkgJson); } else { baseOutputPath = projectRoot; }