forked from software-mansion/react-native-reanimated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabel.config.js
26 lines (26 loc) · 818 Bytes
/
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
module.exports = function (api) {
const disableBabelPlugin = process.env.DISABLE_BABEL_PLUGIN === '1';
// https://babeljs.io/docs/en/config-files#apicache
api.cache.invalidate(() => disableBabelPlugin);
if (disableBabelPlugin) {
console.log('Starting Web example without Babel plugin.');
}
return {
presets: ['babel-preset-expo'],
plugins: [
[
'module-resolver',
{
extensions: ['.js', '.ts', '.tsx'],
alias: {
react: './node_modules/react',
'react-native': './node_modules/react-native-web',
'react-native-reanimated': '../src/index',
},
},
],
'@babel/plugin-proposal-export-namespace-from',
!disableBabelPlugin && 'react-native-reanimated/plugin',
].filter(Boolean),
};
};