react-native-dotenv
Advanced tools
Comparing version 3.4.6 to 3.4.7
@@ -1,3 +0,3 @@ | ||
const {readFileSync, statSync} = require('node:fs') | ||
const path = require('node:path') | ||
const {readFileSync, statSync} = require('fs') | ||
const path = require('path') | ||
const dotenv = require('dotenv') | ||
@@ -93,4 +93,4 @@ | ||
const modeLocalParsed = parseDotenvFile(modeLocalFilePath, options.verbose) | ||
env = (options.safe) ? safeObjectAssign(undefObjectAssign(undefObjectAssign(undefObjectAssign(parsed, modeParsed), localParsed), modeLocalParsed), dotenvTemporary, ['NODE_ENV', 'BABEL_ENV', options.envName]) | ||
: undefObjectAssign(undefObjectAssign(undefObjectAssign(undefObjectAssign(parsed, modeParsed), localParsed), modeLocalParsed), dotenvTemporary) | ||
env = (options.safe) ? safeObjectAssign(undefObjectAssign(undefObjectAssign(undefObjectAssign(parsed, localParsed), modeParsed), modeLocalParsed), dotenvTemporary, ['NODE_ENV', 'BABEL_ENV', options.envName]) | ||
: undefObjectAssign(undefObjectAssign(undefObjectAssign(undefObjectAssign(parsed, localParsed), modeParsed), modeLocalParsed), dotenvTemporary) | ||
@@ -97,0 +97,0 @@ api.addExternalDependency(path.resolve(options.path)) |
{ | ||
"name": "react-native-dotenv", | ||
"version": "3.4.6", | ||
"version": "3.4.7", | ||
"description": "Load environment variables using import statements.", | ||
@@ -31,3 +31,3 @@ "repository": "github:goatandsheep/react-native-dotenv", | ||
"jest": "29.3.1", | ||
"jest-junit": "^14.0.1", | ||
"jest-junit": "^15.0.0", | ||
"xo": "^0.53.1" | ||
@@ -65,2 +65,6 @@ }, | ||
}, | ||
"resolutions": { | ||
"@babel/core": "^7.20.5", | ||
"@babel/runtime": "^7.20.6" | ||
}, | ||
"xo": { | ||
@@ -74,4 +78,6 @@ "semicolon": false, | ||
"unicorn/prefer-module": "off", | ||
"unicorn/prefer-node-protocol": "off", | ||
"node/prefer-global/process": "off", | ||
"n/prefer-global/process": "off" | ||
"n/prefer-global/process": "off", | ||
"prefer-destructuring": "off" | ||
} | ||
@@ -78,0 +84,0 @@ }, |
@@ -24,3 +24,3 @@ # react-native-dotenv [![CircleCI](https://circleci.com/gh/goatandsheep/react-native-dotenv.svg?style=svg)](https://circleci.com/gh/goatandsheep/react-native-dotenv) | ||
This babel plugin lets you inject your environment variables into your react-native environment using dotenv for multiple environments. | ||
This babel plugin lets you inject your environment variables into your Javascript environment using dotenv for multiple environments. It is best suited for use with react native and works with all flavors including web. | ||
@@ -202,2 +202,4 @@ ## Usage | ||
If you are publishing your apps on an auto-publishing platform like EAS (Expo Application Services), make sure to put your secrets on the platform dashboard directly. If you are wondering what environment the platforms choose it is likely `.env.production` (not `.env.prod`) and there is likely no way to change this. | ||
The base set of variables will be `.env` and the environment-specific variables will overwrite them. | ||
@@ -226,3 +228,3 @@ | ||
- Create a `types` folder in your project | ||
- Inside that folder, create a `*.d.ts`file, say, `env.d.ts` | ||
- Inside that folder, create a `*.d.tsx`file, say, `env.d.tsx` | ||
- in that file, declare a module as the following format: | ||
@@ -229,0 +231,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51014
335
22