-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat(metro): use custom babel-transformer #23607
Conversation
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
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.
Lgtm from docs perspective 👍
Co-authored-by: Aman Mittal <amandeepmittal@live.com>
Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines. I've found some issues in your pull request that should be addressed (click on them for more details) 👇
|
Why
Historically, we've avoided using a custom Metro babel transformer because some users leverage this value to transform certain files. However, we need to be able to pass custom options to the babel configuration like
metroTarget
and we also need to ensurebabel-preset-expo
is always used. These two aspects ensure Node.js environments can be accounted for inbabel-preset-expo
.How
babel.config.js
isn't defined.metroTarget
field to the Babel caller. This is eitherclient
,node
, orundefined
. When defined, we'll use this to strip server code, and use more focused babel transforms (not yet implemented).@expo/metro-config/babel-transformer
.Test Plan
Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).