mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-01-12 22:51:09 +08:00
[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:
34
scripts/babel/preset.js
Normal file
34
scripts/babel/preset.js
Normal 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' }]
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user