Skip to content

Commit

Permalink
NervJS#11988 react-native path
Browse files Browse the repository at this point in the history
fix wrong react-native path when project dir contains react-native
  • Loading branch information
foolishchow authored Jun 27, 2022
1 parent 1a3d5c8 commit 16ab063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-rn-supporter/src/taroResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function getReactNativeBasePath (): string {
const reactNativeModuleName = 'react-native'
const rnBasePath = require.resolve(reactNativeModuleName)
const splittings = rnBasePath.split(path.sep)
const index = splittings.indexOf(reactNativeModuleName)
const index = splittings.lastIndexOf(reactNativeModuleName)
return splittings.slice(0, index + 1).join(path.sep)
}

Expand Down

0 comments on commit 16ab063

Please sign in to comment.