From a662f90a93f2b5b61eebc2aea67c5a77467963e7 Mon Sep 17 00:00:00 2001 From: Jess Telford Date: Thu, 14 Jun 2018 14:57:31 +1000 Subject: [PATCH] Programatically pass env vars as a whitelist (#1470) --- src/Bundler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Bundler.js b/src/Bundler.js index 0e8d38bb72c..9c84793729f 100644 --- a/src/Bundler.js +++ b/src/Bundler.js @@ -318,11 +318,14 @@ class Bundler extends EventEmitter { } await this.loadPlugins(); - await loadEnv(Path.join(this.options.rootDir, 'index')); + + if (!this.options.env) { + await loadEnv(Path.join(this.options.rootDir, 'index')); + this.options.env = process.env; + } this.options.extensions = Object.assign({}, this.parser.extensions); this.options.bundleLoaders = this.bundleLoaders; - this.options.env = process.env; if (this.options.watch) { this.watcher = new Watcher();