fix: bring --projectRoot
argument back to start
#572
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
#496 by @thymikee fixed projectRoot from metro config got overriden by ctx.root. I think the real error was taking the root from ctx instead of args. previously, an option '--projectRoot' was enabled. the projectRoot from args should override the metro config, if it exists, like the other options of the cli. this PR makes the
--projectRoot
option work again. and, if not specified will use the config option.Notify:
this should also help with storybook that previously used the
--projectRoot
option to start metro from the storybook root folder, instead of including it in your app (which is very non optimal and the recommendation as of now ). @shilman, @Gongreg is that right?Test Plan:
create a react native project. set a projectRoot option in the metro config to a new file called a.js, check that it work. try using the cli with --projectRoot option set to a new file called b.js, it should override the metro config and load from b.js.