@lab009/magma-config
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -30,7 +30,11 @@ /** | ||
// e.g. /projects/.env.staging | ||
ifElse(DEPLOYMENT)(path.resolve(appRootDir.get(), `${envFile}.${DEPLOYMENT}`)), | ||
ifElse(DEPLOYMENT)( | ||
path.resolve(appRootDir.get(), `${envFile}.${DEPLOYMENT}`) | ||
), | ||
]) | ||
// Find the first env file path match. | ||
const envFilePath = envFileResolutionOrder.find(filePath => fs.existsSync(filePath)) | ||
const envFilePath = envFileResolutionOrder.find(filePath => | ||
fs.existsSync(filePath) | ||
) | ||
@@ -73,3 +77,5 @@ // If we found an env file match the register it. | ||
function bool(name, defaultVal) { | ||
return process.env[name] ? process.env[name] === 'true' || process.env[name] === '1' : defaultVal | ||
return process.env[name] | ||
? process.env[name] === 'true' || process.env[name] === '1' | ||
: defaultVal | ||
} | ||
@@ -76,0 +82,0 @@ |
10
index.js
@@ -44,3 +44,6 @@ /** | ||
if (typeof window !== 'undefined' && typeof window.__CLIENT_CONFIG__ === 'object') { | ||
if ( | ||
typeof window !== 'undefined' && | ||
typeof window.__CLIENT_CONFIG__ === 'object' | ||
) { | ||
configCache = window.__CLIENT_CONFIG__ | ||
@@ -102,3 +105,6 @@ } else { | ||
// This "if" block gets stripped away by webpack for production builds. | ||
if (process.env.BUILD_FLAG_IS_DEV === 'true' && process.env.BUILD_FLAG_IS_CLIENT === 'true') { | ||
if ( | ||
process.env.BUILD_FLAG_IS_DEV === 'true' && | ||
process.env.BUILD_FLAG_IS_CLIENT === 'true' | ||
) { | ||
throw new Error( | ||
@@ -105,0 +111,0 @@ `${errorMessage} We have noticed that you are trying to access this configuration value from the client bundle (i.e. code that will be executed in a browser). For configuration values to be exposed to the client bundle you must ensure that the path is added to the client configuration filter in the project configuration values file.` |
{ | ||
"name": "@lab009/magma-config", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Config for Magma.", | ||
@@ -18,3 +18,3 @@ "repository": "lab009/magma", | ||
"dependencies": { | ||
"@lab009/magma-utils": "1.0.5", | ||
"@lab009/magma-utils": "1.0.6", | ||
"app-root-dir": "1.0.2", | ||
@@ -21,0 +21,0 @@ "dotenv": "4.0.0", |
Sorry, the diff of this file is not supported yet
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
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
15733
229
+ Added@lab009/magma-utils@1.0.6(transitive)
+ Addedhappypack@3.1.0(transitive)
+ Addedserialize-error@2.1.0(transitive)
- Removed@lab009/magma-utils@1.0.5(transitive)
- Removedhappypack@3.0.3(transitive)
Updated@lab009/magma-utils@1.0.6