-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathbabel.config.js
40 lines (39 loc) Β· 1.1 KB
/
babel.config.js
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
/**
* metro-react-native-babel-preset includes
* - @babel/preset-react jsx syntax plugin and transform plugins
* - @babel/preset-typescript transform plugin
*/
module.exports = {
presets: [
'module:metro-react-native-babel-preset',
[
'@babel/preset-react',
{
/**
* runtime: automatic
* - auto imports fn's JSX transpiles to like React
* - adds __source and __self props too for debugging
*/
runtime: 'automatic' // default to classic
/**
* development: true
* - adds __source and __self props too for debugging
* - can't use with runtime: automatic from dupe props errors
* - runtime: classic means no auto imports
*/
}
]
],
plugins: [
[
/**
* Allow custom env vars from Metro
* e.g. RN_ENV=staging react-native start --reset-cache
* Accessible from process.env.RN_ENV
*/
'transform-inline-environment-variables'
],
['babel-plugin-react-docgen-typescript', { exclude: 'node_modules' }],
'react-native-reanimated/plugin'
]
}