Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent Babel registration from transforming plugins with arbitrary c…
…onfig (#1082) Summary: X-link: facebook/react-native#39429 Using `require` after `const registerFn = require('babel/register')` but before `registerFn(config)` causes Babel to transform required code with the default configuration (ie, using a nearby `babel.config.js`, if available). This was causing the Babel plugins loaded by `metro-babel-register` to be (unnecessarily) transformed according to `babel.config.js`, which actually fails if the plugins/presets referenced in `babel.config.js` themselves require transformation. This ensures no code is loaded in between registering Babel as a side effect of requiring Babel register, and replacing that hook with something explicitly configured. ## React Native Changelog: [Internal] ## Metro ``` * **[Fix]:** `metro-babel-register` prevent arbitrary transformation of Babel plugins during registration setup ``` Differential Revision: D49238671
- Loading branch information