dotenv-webpack
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -32,10 +32,21 @@ 'use strict'; | ||
safe: false, | ||
sample: './.env.example', | ||
systemvars: false | ||
}, options); | ||
if (options.sample) { | ||
console.warn('dotend-webpack: "options.sample" is a deprecated property. Please update your configuration to use simple "options.safe".'); | ||
} | ||
var vars = options.systemvars ? _extends({}, process.env) : {}; | ||
var env = this.loadFile(options.path); | ||
var blueprint = options.safe ? this.loadFile(options.sample) : env; | ||
var blueprint = env; | ||
if (options.safe) { | ||
var file = './.env.example'; | ||
if (options.safe !== true) { | ||
file = options.safe; | ||
} | ||
blueprint = this.loadFile(file); | ||
} | ||
Object.keys(blueprint).map(function (key) { | ||
@@ -42,0 +53,0 @@ var value = env[key] || env[key]; |
{ | ||
"name": "dotenv-webpack", | ||
"description": "A simple webpack plugin to support dotenv.", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -49,4 +49,3 @@ # dotenv-webpack | ||
* **path** (`'./env'`) - The path to your environment variables. | ||
* **safe** (`false`) - If false, just load the variables, if true, load the file in the *sample* property. | ||
* **sample** (`'./.env.example'`) - The sample file to use for validation. | ||
* **safe** (`false`) - If false ignore safe-mode, if true load `'./.env.example'`, if a string load that file as the sample. | ||
* **systemvars** (`false`) - Set to true if you would rather load all system variables as well (useful for CI purposes). | ||
@@ -53,0 +52,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
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
8710
76
55