mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 09:41:38 +08:00
Support hermes 0.5
This commit is contained in:
@@ -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' },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user