mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-17 18:06:10 +08:00
Swap React Native CLI paths based on version compatibility in runReactNativeBundleCommand function
This commit is contained in:
@@ -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()],
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user