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

fix expo cli on windows

This commit is contained in:
sunnylqm
2024-08-22 17:15:17 +08:00
parent 5740a3315c
commit 5302c8968f

View File

@@ -54,6 +54,7 @@ async function runReactNativeBundleCommand(
let cliPath = require.resolve('react-native/local-cli/cli.js', { let cliPath = require.resolve('react-native/local-cli/cli.js', {
paths: [process.cwd()], paths: [process.cwd()],
}); });
let usingExpo = false;
try { try {
require.resolve('expo-router', { require.resolve('expo-router', {
paths: [process.cwd()], paths: [process.cwd()],
@@ -64,10 +65,9 @@ async function runReactNativeBundleCommand(
cliPath = require.resolve('@expo/cli', { cliPath = require.resolve('@expo/cli', {
paths: [process.cwd()], paths: [process.cwd()],
}); });
usingExpo = true;
} catch (e) {} } catch (e) {}
const bundleCommand = cliPath.includes('@expo/cli') const bundleCommand = usingExpo ? 'export:embed' : 'bundle';
? 'export:embed'
: 'bundle';
Array.prototype.push.apply(reactNativeBundleArgs, [ Array.prototype.push.apply(reactNativeBundleArgs, [
cliPath, cliPath,
@@ -204,7 +204,7 @@ async function compileHermesByteCode(
} }
const hermesCommand = `${hermesPath}/hermesc`; const hermesCommand = `${hermesPath}/hermesc`;
const args = [ const args = [
'-emit-binary', '-emit-binary',
'-out', '-out',