Summary:
Fixes#23342.
Since Metro [v0.47](https://github.com/facebook/metro/releases/tag/v0.47.0), some babel plugins such as [babel-plugin-module-resolver](https://github.com/tleunen/babel-plugin-module-resolver) or [babel-plugin-import-graphql](https://github.com/detrohutt/babel-plugin-import-graphql) fail to resolve files if the packager is started through Xcode. They receive wrong filenames from Babel such as `${projectRoot}/node_modules/react-native/src/index.js` instead of `${projectRoot}/src/index.js`.
It happens because the start command of the local-cli is not executed in the projectRoot directory. In this case, the cwd will be `${projectRoot}/node_modules/react-native`.
This issue doesn't occur if you start the packager yourself using `node node_modules/react-native/local-cli/cli.js start` from your project root.
It comes from this [line](b640b6faf7/scripts/packager.sh (L11)). This script changed the working directory to `${projectRoot}/node_modules/react-native` and started Metro from there.
Starting Metro from the project root fixes this issue.
[iOS] [Fixed] - Start Metro packager from project root
Pull Request resolved: https://github.com/facebook/react-native/pull/24070
Differential Revision: D14563996
Pulled By: cpojer
fbshipit-source-id: cdeff34610f1ebb5fb7bc82a96f4ac9eec750d16