mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Update build to better locate prepack script (#55536)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55536 Changelog: [Internal] Reviewed By: vzaidman Differential Revision: D92831007 fbshipit-source-id: 60089442334ca5be6046bfd7f16c816d57e62408
This commit is contained in:
1 parent
6802eb92ff
commit
b97ca6eacf
1 file changed
+9
-4
@@ -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}`));
|
||||
|
||||
Reference in new issue
Block a user