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