module.exports = function() {
  return {
    presets: ['module:metro-react-native-babel-preset'],
    plugins: [
      [
        'babel-plugin-module-resolver',
        {
          alias: {
            'react-native-vector-icons': '@expo/vector-icons',
          },
        },
      ],
      ['@babel/plugin-proposal-decorators', { legacy: true }],
    ],
  };
};

module.exports = function(api) {
  const isWeb = api.caller(isTargetWeb);

  return {
    presets: ['module:metro-react-native-babel-preset'],
    plugins: [
      [
        'babel-plugin-module-resolver',
        {
          alias: {
            'react-native-vector-icons': '@expo/vector-icons',
          },
        },
      ],
      ['@babel/plugin-proposal-decorators', { legacy: true }],
    ],
  };
};

function isTargetWeb(caller) {
  return caller && caller.name === 'babel-loader';
}

Update preset to be able to detect if it's run from Webpack's babel-loader
[babel] Update preset to be able to detect if it's run from Webpack's babel-loader
