This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(env): Switch to using react-native-dotenv (#197 by @jamonholmgren)
- Loading branch information
1 parent
e8b5d9e
commit 3af9874
Showing
7 changed files
with
18 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,15 @@ | ||
{ | ||
"presets": ["module:metro-react-native-babel-preset"], | ||
"presets": ["module:metro-react-native-babel-preset", "module:react-native-dotenv"], | ||
"env": { | ||
"production": { | ||
} | ||
"production": {} | ||
}, | ||
"plugins": [ | ||
[ | ||
"transform-inline-environment-variables", | ||
{ | ||
"include": ["NODE_ENV", "API"] | ||
} | ||
], | ||
[ | ||
"@babel/plugin-proposal-decorators", | ||
{ | ||
"legacy": true | ||
} | ||
], | ||
[ | ||
"@babel/plugin-proposal-optional-catch-binding" | ||
] | ||
["@babel/plugin-proposal-optional-catch-binding"] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# This is an example where you can store your environment variables. Copy this file to .env | ||
# Now your app will have access to the variables added below. | ||
# For more instructions see section "Secrets" in README.md | ||
# This is an example where you can store your environment variables. | ||
# It uses `react-native-dotenv` as a babel transform. | ||
# | ||
# Then just do this to import them: | ||
# import { API_URL } from 'react-native-dotenv' | ||
|
||
API_URL=https://myapi.com | ||
GOOGLE_MAPS_API_KEY=abcdefgh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters