-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathbabel.config.js
43 lines (40 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
module.exports = (api) => {
const babelEnv = api.env()
const plugins = [
['@babel/plugin-transform-react-jsx', { runtime: 'automatic' }],
'@babel/plugin-transform-export-namespace-from',
[
'module-resolver',
{
extensions: ['.js', '.jsx', '.ts', '.tsx'],
root: ['.'],
alias: {
'@audius/common/adapters': '../common/src/adapters',
'@audius/common/messages': '../common/src/messages',
'@audius/common/hooks': '../common/src/hooks',
'@audius/common/context': '../common/src/context',
'@audius/common/api': '../common/src/api',
'@audius/common/models': '../common/src/models',
'@audius/common/utils': '../common/src/utils',
'@audius/common/schemas': '../common/src/schemas',
'@audius/common/services': '../common/src/services',
'@audius/common/audius-query': '../common/src/audius-query',
'@audius/common/store': '../common/src/store'
}
}
]
]
if (babelEnv !== 'development') {
plugins.push(['transform-remove-console', { exclude: ['error', 'warn'] }])
}
plugins.push('react-native-reanimated/plugin')
return {
presets: [
[
'module:@react-native/babel-preset',
{ useTransformReactJSXExperimental: true }
]
],
plugins
}
}