mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 17:15:54 +00:00
e6cb02d61a
Summary: Rather than specifying Babel plugins in the `.babelrc` packaged with react-native, leverage a Babel preset to define the plugins (https://github.com/exponentjs/babel-preset-react-native). This allows for a much better user experience for those who want (or need) to override options in their project's `.babelrc`. Prior to this PR, if a user wanted to use a custom babel-plugin (or a custom set of babel plugins), they'd have either 1) manually override the `.babelrc` in the react-packager directory (or fork RN), or 2) specify a custom transformer to use when running the packager that loaded their own `.babelrc`. Note - the custom transformer was necessary because without it, RN's `.babelrc` options would supersede the options defined in the project's `.babelrc`...potentially causing issues with plugin ordering. This PR makes the transformer check for the existence of a project-level `.babelrc`, and if it it's there, it _doesn't_ use the react-native `.babelrc`. This prevents any oddities with Babel plug Closes https://github.com/facebook/react-native/pull/5214 Reviewed By: davidaurelio Differential Revision: D2881814 Pulled By: martinbigio fb-gh-sync-id: 4168144b7a365fae62bbeed094d8a03a48b4798c
36 lines
2.6 KiB
JavaScript
36 lines
2.6 KiB
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
'use strict';
|
|
|
|
module.exports = {
|
|
'babel-plugin-react-transform': require('babel-plugin-react-transform'),
|
|
'babel-plugin-syntax-async-functions': require('babel-plugin-syntax-async-functions'),
|
|
'babel-plugin-syntax-class-properties': require('babel-plugin-syntax-class-properties'),
|
|
'babel-plugin-syntax-trailing-function-commas': require('babel-plugin-syntax-trailing-function-commas'),
|
|
'babel-plugin-transform-class-properties': require('babel-plugin-transform-class-properties'),
|
|
'babel-plugin-transform-es2015-arrow-functions': require('babel-plugin-transform-es2015-arrow-functions'),
|
|
'babel-plugin-transform-es2015-block-scoping': require('babel-plugin-transform-es2015-block-scoping'),
|
|
'babel-plugin-transform-es2015-classes': require('babel-plugin-transform-es2015-classes'),
|
|
'babel-plugin-transform-es2015-computed-properties': require('babel-plugin-transform-es2015-computed-properties'),
|
|
'babel-plugin-transform-es2015-constants': require('babel-plugin-transform-es2015-constants'),
|
|
'babel-plugin-transform-es2015-destructuring': require('babel-plugin-transform-es2015-destructuring'),
|
|
'babel-plugin-transform-es2015-modules-commonjs': require('babel-plugin-transform-es2015-modules-commonjs'),
|
|
'babel-plugin-transform-es2015-parameters': require('babel-plugin-transform-es2015-parameters'),
|
|
'babel-plugin-transform-es2015-shorthand-properties': require('babel-plugin-transform-es2015-shorthand-properties'),
|
|
'babel-plugin-transform-es2015-spread': require('babel-plugin-transform-es2015-spread'),
|
|
'babel-plugin-transform-es2015-template-literals': require('babel-plugin-transform-es2015-template-literals'),
|
|
'babel-plugin-transform-flow-strip-types': require('babel-plugin-transform-flow-strip-types'),
|
|
'babel-plugin-transform-object-assign': require('babel-plugin-transform-object-assign'),
|
|
'babel-plugin-transform-object-rest-spread': require('babel-plugin-transform-object-rest-spread'),
|
|
'babel-plugin-transform-react-display-name': require('babel-plugin-transform-react-display-name'),
|
|
'babel-plugin-transform-react-jsx': require('babel-plugin-transform-react-jsx'),
|
|
'babel-plugin-transform-regenerator': require('babel-plugin-transform-regenerator'),
|
|
'babel-plugin-transform-es2015-for-of': require('babel-plugin-transform-es2015-for-of'),
|
|
};
|