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

feat: support expo

This commit is contained in:
sunnylqm
2024-02-03 21:27:47 +08:00
parent 6a053c6428
commit 7c20b30c85

View File

@@ -49,11 +49,21 @@ async function runReactNativeBundleCommand(
fs.emptyDirSync(outputFolder);
Array.prototype.push.apply(reactNativeBundleArgs, [
require.resolve('react-native/local-cli/cli.js', {
let cliPath = require.resolve('react-native/local-cli/cli.js', {
paths: [process.cwd()],
}), // 'react-native' package may be symlinked
'bundle',
});
try {
cliPath = require.resolve('@expo/cli', {
paths: [process.cwd()],
});
} catch (e) {}
const bundleCommand = cliPath.includes('@expo/cli')
? 'export:embed'
: 'bundle';
Array.prototype.push.apply(reactNativeBundleArgs, [
cliPath,
bundleCommand,
'--assets-dest',
outputFolder,
'--bundle-output',
@@ -204,7 +214,10 @@ async function compileHermesByteCode(
if (sourcemapOutput) {
args.push('-output-source-map');
}
spawnSync(path.join.apply(null, hermesCommand.split('/')), args, {
console.log(
'Running hermesc: ' + hermesCommand + ' ' + args.join(' ') + '\n',
);
spawnSync(hermesCommand, args, {
stdio: 'ignore',
});
}