2021-03-18 08:56:05 +03:00
|
|
|
module.exports = (api) => {
|
|
|
|
const babelEnv = api.env();
|
|
|
|
const plugins = [];
|
2022-11-08 13:54:57 +03:00
|
|
|
// change to 'production' to check if this is working in 'development' mode
|
2021-03-18 08:56:05 +03:00
|
|
|
if (babelEnv !== 'development') {
|
|
|
|
plugins.push(['transform-remove-console', { exclude: ['error', 'warn'] }]);
|
|
|
|
}
|
2022-03-01 15:36:05 +03:00
|
|
|
|
2022-11-08 13:54:57 +03:00
|
|
|
// Reanimated should be last plugin added in babel
|
2022-03-01 15:36:05 +03:00
|
|
|
plugins.push(['react-native-reanimated/plugin']);
|
2021-03-18 08:56:05 +03:00
|
|
|
return {
|
|
|
|
presets: ['module:metro-react-native-babel-preset'],
|
|
|
|
sourceMaps: true,
|
|
|
|
plugins,
|
|
|
|
};
|
2019-05-29 14:32:35 +03:00
|
|
|
};
|