小编sha*_*oof的帖子

为react-native 0.60.6配置transform-inline-environment-variables

module.exports = function () {
  return {
    "presets": ['module:metro-react-native-babel-preset'],
    "plugins": [
      ["transform-inline-environment-variables", {
        "include": [
          "APP_ENV"
        ]
      }]
    ]
  }
};
Run Code Online (Sandbox Code Playgroud)

这是我的react-native项目的babel.config.js,我正在尝试配置transform-inline-environment-variables babel插件。但每当我运行应用程序时,环境变量总是未定义。

我运行react-native start --reset-cache以清除缓存并使用命令运行项目APP_ENV=dev react-native run-ios

但该变量仍然未定义。我在这里做错了什么?React-native版本是0.60.6

plugins babeljs react-native

5
推荐指数
1
解决办法
6268
查看次数

标签 统计

babeljs ×1

plugins ×1

react-native ×1