From a00240adee4a3445047166abbf520632683730f7 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Thu, 12 Feb 2026 08:34:11 -0800 Subject: [PATCH] Update build to better locate prepack script Summary: Changelog: [Internal] Differential Revision: D92831007 --- scripts/build/build.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/build/build.js b/scripts/build/build.js index d96c4f080c2c..9ff364c58c6c 100644 --- a/scripts/build/build.js +++ b/scripts/build/build.js @@ -124,10 +124,15 @@ async function buildPackage(packageName /*: string */, prepack /*: boolean */) { // Run prepack script if configured if (prepack) { await new Promise((resolve, reject) => { - const child = spawn('npm', ['run', 'prepack'], { - cwd: path.resolve(PACKAGES_DIR, packageName), - stdio: ['ignore', 'ignore', 'inherit'], - }); + const packagePath = path.resolve(PACKAGES_DIR, packageName); + const child = spawn( + process.execPath, + [path.join(__dirname, 'prepack.js')], + { + cwd: packagePath, + stdio: ['ignore', 'ignore', 'inherit'], + }, + ); child.on('close', code => { if (code !== 0) { reject(new Error(`prepack script exited with code ${code}`));