fix: Fix loading Metro config from alternative config path - #2043
Merged
thymikee merged 1 commit intoAug 7, 2023
Conversation
huntie
force-pushed
the
load-metro-config-fix
branch
from
August 2, 2023 15:15
0c95dec to
3878e97
Compare
huntie
force-pushed
the
load-metro-config-fix
branch
from
August 2, 2023 15:20
3878e97 to
26c8f64
Compare
huntie
marked this pull request as ready for review
August 2, 2023 15:24
Collaborator
|
We need to release this change and backport to 0.72. cc. @thymikee |
Member
|
@huntie mind creating a second PR targeting the 12.x branch please? 🙏🏼 |
2 tasks
facebook-github-bot
pushed a commit
to react/react-native
that referenced
this pull request
Aug 15, 2023
Summary: Pull Request resolved: #38944 - Update `cli-commands` package to reflect latest source `react-native-community/cli-plugin-metro` changes. - react-native-community/cli#2021 - react-native-community/cli#2024 - react-native-community/cli#2043 - react-native-community/cli#2047 ### To do WARNING: ~~This PR is non-functional until the next CLI alpha is published and bumped in `package.json` — since it depends on corresponding new APIs in `react-native-community/cli-tools` (react-native-community/cli#2021). This package (and the upcoming work which integrates it) has been tested against locally linked copies of latest CLI.~~ - [x] Bump CLI dependencies when next alpha published. - [x] Ensure Metro bump from `0.77.0` to `0.78.0` is consistently applied with this. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48066179 fbshipit-source-id: b3dc8891cf33e537788f942dcaddff4d2f11a31f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Resolves #2042. Config validation within
loadMetroConfigwas not passingoptions.configto Metro'sresolveConfigfunction — where this is done later forloadConfig.Test Plan
No
--configarg (Unchanged)✅ Implicitly loads
./metro.config.jsWith
--configspecified✅ Loads
metro.config.jsfile from alternative file pathWith
--configspecified, file does not exist✅ Throws underlying error from Metro
(Note: This error message could be improved in Metro's source — to keep CLI lean I'm not wrapping this with anything now as the error is just about clear enough, cc @robhogan)