-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to override default metro config #207
Conversation
@jakub-gonet is attempting to deploy a commit to the software-mansion Team on Vercel. To accomplish this, @jakub-gonet needs to request access to the Team. Afterwards, an owner of the Team is required to accept their membership request. If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account. |
"**/metro.config.{js,ts}", | ||
"**/node_modules" | ||
); | ||
let metroConfigGlob = "**/metro.config.{js,ts}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't be searching for the file. If it is specified, it needs to give you path relative to the workspace root. We can test if the file indeed exists, but searching for it is just too much as we may accidentally find other, conflicting files this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it from the extension code – you can only construct paths relative to the workspace and we check roots from the workspaces before this check. I changed the code in metro.ts
to construct paths against workspace folders and removed recursive search from there.
01ccde0
to
d7e5166
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
The option is set in the
launch.json
undermetroConfigPath
key.To test it, create another metro config (e.g.
metro.config.dev.js
), set the key in the configuration and addblocklist: [/App\.tsx/]
(you can use any other imported file) in the metro resolver options. After rebundling, you should get bundle error saying that the module wasn't found.Fixes #180.