forked from bitpay/bitpay-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbabel.config.js
More file actions
45 lines (40 loc) · 1 KB
/
Copy pathbabel.config.js
File metadata and controls
45 lines (40 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const {NODE_ENV} = process.env;
const prod = NODE_ENV === 'production';
const plugins = [
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-transform-shorthand-properties',
'@babel/plugin-transform-arrow-functions',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-transform-template-literals',
[
'module:react-native-dotenv',
{
moduleName: '@env',
path: prod ? '.env.production' : '.env.development',
safe: true,
allowUndefined: true,
},
],
[
'module-resolver',
{
root: ['./src'],
extensions: ['.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json'],
alias: {
'@components': './src/components',
},
},
],
];
if (prod) {
plugins.push('transform-remove-console');
}
plugins.push('react-native-worklets/plugin');
module.exports = {
presets: [
'module:@react-native/babel-preset',
'module:@babel/preset-typescript',
],
plugins,
};