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

Swap React Native CLI paths based on version compatibility in runReactNativeBundleCommand function

This commit is contained in:
sunnylqm
2025-03-17 11:25:11 +08:00
parent d2798d3177
commit ef7f6a2087
2 changed files with 5 additions and 5 deletions

View File

@@ -102,13 +102,13 @@ async function runReactNativeBundleCommand({
const getRnCli = () => {
try {
// rn >= 0.75
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
// rn < 0.75
cliPath = require.resolve('react-native/local-cli/cli.js', {
paths: [process.cwd()],
});
} catch (e) {
// rn < 0.75
cliPath = require.resolve('react-native/local-cli/cli.js', {
// rn >= 0.75
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
paths: [process.cwd()],
});
}