mirror of
https://github.com/status-im/react-native.git
synced 2025-01-19 05:51:01 +00:00
858643dbdf
Summary: Putting this up as request for comments. The PR adds [transform-react-jsx-source](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source) to the list of plugins that come by default with the `react-native` preset. It will enable the use of a bunch of really cool tooling around JSX, however those are generally useful only in development mode. Is changing `react-native` preset the right thing to do in this case? Is there a way to enable this transform only in DEV? Should I add this somewhere else? Closes https://github.com/facebook/react-native/pull/6351 Differential Revision: D3302906 Pulled By: frantic fbshipit-source-id: 012d3a4142168f9f90d30d1686115d4dc3996eb9
50 lines
1.5 KiB
JavaScript
50 lines
1.5 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';
|
|
|
|
var resolvePlugins = require('../lib/resolvePlugins');
|
|
|
|
module.exports = {
|
|
comments: false,
|
|
compact: true,
|
|
plugins: resolvePlugins([
|
|
'syntax-async-functions',
|
|
'syntax-class-properties',
|
|
'syntax-trailing-function-commas',
|
|
'transform-class-properties',
|
|
'transform-es2015-function-name',
|
|
'transform-es2015-arrow-functions',
|
|
'transform-es2015-block-scoping',
|
|
'transform-es2015-classes',
|
|
'transform-es2015-computed-properties',
|
|
'check-es2015-constants',
|
|
'transform-es2015-destructuring',
|
|
['transform-es2015-modules-commonjs', { strict: false, allowTopLevelThis: true }],
|
|
'transform-es2015-parameters',
|
|
'transform-es2015-shorthand-properties',
|
|
'transform-es2015-spread',
|
|
'transform-es2015-template-literals',
|
|
'transform-flow-strip-types',
|
|
'transform-object-assign',
|
|
'transform-object-rest-spread',
|
|
'transform-react-display-name',
|
|
'transform-react-jsx',
|
|
'transform-regenerator',
|
|
['transform-es2015-for-of', { loose: true }],
|
|
require('../transforms/transform-symbol-member'),
|
|
]),
|
|
env: {
|
|
development: {
|
|
plugins: resolvePlugins(['transform-react-jsx-source']),
|
|
},
|
|
},
|
|
retainLines: true,
|
|
sourceMaps: false,
|
|
};
|