forked from zed-io/kolektivo-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
39 lines (37 loc) · 1.38 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
let moduleResolverPluginConfig = []
if (!process.env.JEST_WORKER_ID) {
// Jest has a resolution process for manual mocks (e.g., __mocks__/src) and
// module-resolver conflicts with it. The result is imports resolve to the
// non-mocked modules instead of the mocked ones. Jest also has it's own
// resolution config (moduleNameMapper) so module-resolver is superfluous.
moduleResolverPluginConfig[0] = [
'module-resolver',
{
root: ['.'],
alias: {
'^src/(.+)$': './src/\\1',
'^locales$': './locales',
},
},
]
}
module.exports = {
plugins: [
[require('@babel/plugin-proposal-decorators').default, { legacy: true }],
[
'module:react-native-dotenv',
{
moduleName: 'react-native-dotenv',
path: 'e2e/.env',
},
],
// Remove @babel/plugin-proposal-numeric-separator when we upgrade metro with the upstream fix (https://github.com/facebook/metro/pull/681)
'@babel/plugin-proposal-numeric-separator',
// Remove @babel/plugin-transform-named-capturing-groups-regex once hermes supports named capture groups (https://github.com/facebook/hermes/issues/696)
'@babel/plugin-transform-named-capturing-groups-regex',
...moduleResolverPluginConfig,
'react-native-reanimated/plugin',
// NOTE: Reanimated plugin has to be listed last.
],
presets: ['module:metro-react-native-babel-preset'],
}