-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbabel.config.js
51 lines (50 loc) · 1.32 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
41
42
43
44
45
46
47
48
49
50
51
/** @type {import('@babel/core').TransformOptions['plugins']} */
const plugins = [
[
/** Enables baseUrl: "./" option in tsconfig.json to work @see https://github.com/entwicklerstube/babel-plugin-root-import */
'babel-plugin-root-import',
{
paths: [
{
rootPathPrefix: 'app/',
rootPathSuffix: 'app',
},
{
rootPathPrefix: 'assets/',
rootPathSuffix: 'assets',
},
{
rootPathPrefix: 'core/',
rootPathSuffix: 'core',
},
],
},
],
/** react-native-reanimated web support @see https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/#web */
[
'@babel/plugin-proposal-decorators',
{
legacy: true,
},
],
'@babel/plugin-proposal-export-namespace-from',
/** NOTE: This must be last in the plugins @see https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/#babel-plugin */
'react-native-reanimated/plugin',
]
/** @type {import('@babel/core').TransformOptions} */
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
env: {
production: {
plugins: [
[
'transform-remove-console',
{
exclude: ['error', 'warn'],
},
],
],
},
},
plugins,
}