[fix] babel-plugin support for 'react-native-web' module name

Now rewrites import/export/require statements from 'react-native-web'.
Install the plugin in the 'benchmarks' package.
This commit is contained in:
Nicolas Gallagher
2018-01-01 12:01:22 -08:00
parent 46e77d0b00
commit 209bd3aee1
13 changed files with 372 additions and 368 deletions

34
scripts/babel/preset.js Normal file
View File

@@ -0,0 +1,34 @@
module.exports = {
presets: [
[
'babel-preset-env',
{
loose: true,
exclude: ['transform-es2015-typeof-symbol'],
targets: {
browsers: [
'chrome 38',
'android 4',
'firefox 40',
'ios_saf 7',
'safari 7',
'ie 10',
'ie_mob 11',
'edge 12',
'opera 16',
'op_mini 12',
'and_uc 9',
'and_chr 38'
]
}
}
],
'babel-preset-react',
'babel-preset-flow'
],
plugins: [
['babel-plugin-transform-class-properties', { loose: true }],
['babel-plugin-transform-object-rest-spread', { useBuiltIns: true }],
['babel-plugin-transform-react-remove-prop-types', { mode: 'wrap' }]
]
};