Skip to content
πŸš‡ The JavaScript bundler for React Native.
JavaScript
Branch: master
Clone or download
EvanBacon and facebook-github-bot Added `extendsBabelConfigPath` option for using a non-standard babel …
…config location (#460)

Summary:
**Summary**

Added an option `extendsBabelConfigPath` for extending a custom babel preset.

**Test plan**

`metro.config.js`
```js
module.exports = {
  transformer: {
     babelTransformerPath: require.resolve('./transformer.js'),
  },
}
```

`transformer.js`
```js
const transformer = require('metro-react-native-babel-transformer');

module.exports.getCacheKey = transformer.getCacheKey;

module.exports.transform = function({ filename, options, src, plugins }) {
  return transformer.transform({
    filename,
    options: Object.assign(options, { extendsBabelConfigPath: require.resolve('babel-preset-cool-custom-thing') }),
    src,
    plugins
  });
};
```
Pull Request resolved: #460

Differential Revision: D18201840

Pulled By: cpojer

fbshipit-source-id: a729e8be77803762211abe52ce13aa7d0b690dd2
Latest commit 1955300 Oct 29, 2019

README.md

Metro

CircleCI Build Status npm version codecov

πŸš‡ The JavaScript bundler for React Native.

  • πŸš… Fast: We aim for sub-second reload cycles, fast startup and quick bundling speeds.
  • βš–οΈ? Scalable: Works with thousands of modules in a single application.
  • βš›οΈ? Integrated: Supports every React Native project out of the box.

This project was previously part of the react-native repository. In this smaller repository it is easier for the team working on Metro to respond to both issues and pull requests. See react-native#13976 for the initial announcement.

Installation & Documentation

See the Metro website for documentation.

License

Metro is MIT licensed, as found in the LICENSE file.

You can’t perform that action at this time.