-
Notifications
You must be signed in to change notification settings - Fork 25
/
babel.config.js
49 lines (49 loc) · 1.52 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
/**
* Configure Babel for Expo project with module resolution aliases.
* This function sets up Babel presets and plugins, including module resolution with aliases.
* @param {object} api - The Babel API object (optional, used for caching).
* @param {Function} api.cache - Function used for caching Babel configuration.
* @returns {object} Babel configuration object with presets and plugins.
*/
// eslint-disable-next-line fp/no-mutation
module.exports = function(api = { cache: () => {} }) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
[
'module-resolver',
{
cwd: 'babelrc',
root: ['./src'],
extensions: ['.js', '.ios.js', '.android.js'],
alias: {
'@app': './app',
'@assets': './app/assets',
'@components': './app/components',
'@atoms': './app/components/atoms',
'@molecules': './app/components/molecules',
'@organisms': './app/components/organisms',
'@config': './app/config',
'@navigators': './app/navigators',
'@scenes': './app/scenes',
'@services': './app/services',
'@themes': './app/themes',
'@utils': './app/utils'
}
}
],
[
'module:react-native-dotenv',
{
moduleName: '@env',
path: '.env',
blacklist: null,
whitelist: null,
safe: false,
allowUndefined: true
}
]
]
};
};