From cfdc26f71d05a9e735d30b7f2740affb4bba0cd0 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Wed, 28 Aug 2019 12:21:18 +0800 Subject: [PATCH] =?UTF-8?q?hermes=E8=B7=AF=E5=BE=84=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- local-cli/src/bundle.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/local-cli/src/bundle.js b/local-cli/src/bundle.js index a9619cf..e6e1177 100644 --- a/local-cli/src/bundle.js +++ b/local-cli/src/bundle.js @@ -110,8 +110,9 @@ async function compileHermesByteCode(bundleName, outputFolder) { } catch (e) {} if (enableHermes) { console.log(`Hermes enabled, now compiling to hermes bytecode:\n`); + const hermesPath = fs.existsSync('node_modules/hermes-engine') ? 'node_modules/hermes-engine' : 'node_modules/hermesvm'; exec(` -node_modules/hermesvm/${getHermesOSBin()}/hermes -emit-binary -out ${outputFolder}/${bundleName} ${outputFolder}/${bundleName} -O +${hermesPath}/${getHermesOSBin()}/hermes -emit-binary -out ${outputFolder}/${bundleName} ${outputFolder}/${bundleName} -O echo Compiling done. `); } @@ -421,9 +422,9 @@ export const commands = { throw new Error('Platform must be specified.'); } - // const { version, major, minor } = getRNVersion(); + const { version, major, minor } = getRNVersion(); - // console.log('Bundling with React Native version: ', version); + console.log('Bundling with React Native version: ', version); await runReactNativeBundleCommand(bundleName, dev, entryFile, intermediaDir, platform);