📜  如何从反应原生应用程序中删除 console.log - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:52.550000             🧑  作者: Mango

代码示例1
module.exports = api => {
  const babelEnv = api.env();
  const plugins = [];
  //change to 'production' to check if this is working in 'development' mode
  if (babelEnv !== 'development') {
    plugins.push(['transform-remove-console', {exclude: ['error', 'warn']}]);
  }
  return {
    presets: ['module:metro-react-native-babel-preset'],
    plugins,
  };
};