Skip to content

Commit b97ca6e

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Update build to better locate prepack script (#55536)
Summary: Pull Request resolved: #55536 Changelog: [Internal] Reviewed By: vzaidman Differential Revision: D92831007 fbshipit-source-id: 60089442334ca5be6046bfd7f16c816d57e62408
1 parent 6802eb9 commit b97ca6e

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

scripts/build/build.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,15 @@ async function buildPackage(packageName /*: string */, prepack /*: boolean */) {
124124
// Run prepack script if configured
125125
if (prepack) {
126126
await new Promise((resolve, reject) => {
127-
const child = spawn('npm', ['run', 'prepack'], {
128-
cwd: path.resolve(PACKAGES_DIR, packageName),
129-
stdio: ['ignore', 'ignore', 'inherit'],
130-
});
127+
const packagePath = path.resolve(PACKAGES_DIR, packageName);
128+
const child = spawn(
129+
process.execPath,
130+
[path.join(__dirname, 'prepack.js')],
131+
{
132+
cwd: packagePath,
133+
stdio: ['ignore', 'ignore', 'inherit'],
134+
},
135+
);
131136
child.on('close', code => {
132137
if (code !== 0) {
133138
reject(new Error(`prepack script exited with code ${code}`));

0 commit comments

Comments
 (0)