Skip to content

Commit a662f90

Browse files
jesstelforddevongovett
authored andcommitted
Programatically pass env vars as a whitelist (#1470)
1 parent 86731cc commit a662f90

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Bundler.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,14 @@ class Bundler extends EventEmitter {
318318
}
319319

320320
await this.loadPlugins();
321-
await loadEnv(Path.join(this.options.rootDir, 'index'));
321+
322+
if (!this.options.env) {
323+
await loadEnv(Path.join(this.options.rootDir, 'index'));
324+
this.options.env = process.env;
325+
}
322326

323327
this.options.extensions = Object.assign({}, this.parser.extensions);
324328
this.options.bundleLoaders = this.bundleLoaders;
325-
this.options.env = process.env;
326329

327330
if (this.options.watch) {
328331
this.watcher = new Watcher();

0 commit comments

Comments
 (0)