mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-05 03:09:23 +00:00
Reorganize monorepo structure
* Move all config files to './configs' * Simplify './scripts' folder.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
module.exports = function (api) {
|
||||
if (api) {
|
||||
api.cache(true);
|
||||
}
|
||||
|
||||
let modules = false;
|
||||
|
||||
if (process.env.BABEL_ENV === 'commonjs' || process.env.NODE_ENV === 'test') {
|
||||
modules = 'commonjs';
|
||||
}
|
||||
|
||||
return {
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
loose: true,
|
||||
modules,
|
||||
exclude: ['transform-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-flow-strip-types',
|
||||
['babel-plugin-transform-react-remove-prop-types', { mode: 'wrap' }],
|
||||
['@babel/plugin-proposal-class-properties', { loose: true }],
|
||||
['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }],
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator'
|
||||
].concat(modules ? ['babel-plugin-add-module-exports'] : [])
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user