1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-09-16 09:41:38 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Support hermes 0.5

This commit is contained in:
sunnylqm
2020-04-15 00:02:35 +08:00
parent ef28133cfc
commit a343999cb6

View File

@@ -138,11 +138,17 @@ async function compileHermesByteCode(bundleName, outputFolder) {
} catch (e) {} } catch (e) {}
if (enableHermes) { if (enableHermes) {
console.log(`Hermes enabled, now compiling to hermes bytecode:\n`); console.log(`Hermes enabled, now compiling to hermes bytecode:\n`);
const hermesPath = fs.existsSync('node_modules/hermes-engine') const hermesPackage = fs.existsSync('node_modules/hermes-engine')
? 'node_modules/hermes-engine' ? 'node_modules/hermes-engine' // 0.2+
: 'node_modules/hermesvm'; : 'node_modules/hermesvm'; // < 0.2
const hermesPath = `${hermesPackage}/${getHermesOSBin()}`;
const hermesCommand = fs.existsSync(`${hermesPath}/hermesc`)
? `${hermesPath}/hermesc` // 0.5+
: `${hermesPath}/hermes`; // < 0.5
execSync( execSync(
`${hermesPath}/${getHermesOSBin()}/hermes -emit-binary -out ${outputFolder}/${bundleName} ${outputFolder}/${bundleName} -O`, `${hermesCommand} -emit-binary -out ${outputFolder}/${bundleName} ${outputFolder}/${bundleName} -O`,
{ stdio: 'ignore' }, { stdio: 'ignore' },
); );
} }