小编The*_*i M的帖子

React Native 0.60.3 babel-plugin-transform-remove-console 不工作

我正在尝试从我的 react-native 应用程序的输出中删除 console.log 输出,但是当我运行时

ENVFILE=.env.production react-native run-android --variant=release

亚行日志猫

我仍然看到我的应用程序的数据被记录到控制台。

我使用了以下文档:https : //facebook.github.io/react-native/docs/performance.html#using-consolelog-statements

这是我的 .babelrc 文件:

{
  "presets": ["react-native"],
  "env": {
    "production": {
      "plugins": ["transform-remove-console"]
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

我错过了什么?我在 react-native 0.60.3 上使用 "babel-plugin-transform-remove-console": "^6.9.4",

reactjs babeljs react-native

9
推荐指数
1
解决办法
4603
查看次数

标签 统计

babeljs ×1

react-native ×1

reactjs ×1