From 070991d08bc994763056e6766ba465cb45165097 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Tue, 5 Mar 2024 23:29:05 +0800 Subject: [PATCH] fix: hermes path --- src/bundle.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/bundle.js b/src/bundle.js index ac4a626..9d92af7 100644 --- a/src/bundle.js +++ b/src/bundle.js @@ -196,22 +196,15 @@ async function compileHermesByteCode( paths: [process.cwd()], }), ); - let hermesCommand = path.join( - rnDir, - `/sdks/hermesc/${getHermesOSBin()}/hermesc`, - ); + let hermesPath = path.join(rnDir, `/sdks/hermesc/${getHermesOSBin()}`); // < rn 0.69 - if (!fs.existsSync(hermesCommand)) { - const hermesPackage = fs.existsSync('node_modules/hermes-engine') - ? 'node_modules/hermes-engine' // 0.2+ - : 'node_modules/hermesvm'; // < 0.2 - const hermesPath = `${hermesPackage}/${getHermesOSBin()}`; - - hermesCommand = fs.existsSync(`${hermesPath}/hermesc`) - ? `${hermesPath}/hermesc` // 0.5+ - : `${hermesPath}/hermes`; // < 0.5 + if (!fs.existsSync(hermesPath)) { + hermesPath = `node_modules/hermes-engine/${getHermesOSBin()}`; } + + const hermesCommand = `${hermesPath}/hermesc`; + const args = [ '-emit-binary', '-out',