-
Notifications
You must be signed in to change notification settings - Fork 36
/
babel.config.js
57 lines (53 loc) · 1.48 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
52
53
54
55
56
57
function getAliasesFromTsConfig() {
const tsConfig = require('./tsconfig.json')
const paths = tsConfig.compilerOptions.paths
let alias = {}
Object.keys(paths).forEach((key) => {
alias[key] = `./${paths[key][0]}`
})
return alias
}
const baseConfig = {
presets: ['module:@react-native/babel-preset'],
plugins: [
[
'module-resolver',
{
alias: {
// This needs to be mirrored in tsconfig.json
'@helium/crypto': './node_modules/@helium/crypto-react-native',
'@assets': './src/assets',
'@components': './src/components',
'@constants': './src/constants',
'@hooks': './src/hooks',
'@theme': './src/theme',
'@utils': './src/utils',
'@storage': './src/storage',
'@types': './src/types',
'@features': './src/features',
'@services': './src/services',
'@store': './src/store',
'@/solana': './src/solana',
},
extensions: ['.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json'],
root: ['./src'],
},
],
],
}
module.exports = (api) => {
api.cache(true)
return {
...baseConfig,
plugins: [...baseConfig.plugins, 'react-native-reanimated/plugin'],
env: {
// Uncomment if you want to remove all logs in development
// development: {
// plugins: ['transform-remove-console'],
// },
production: {
plugins: ['transform-remove-console'],
},
},
}
}