From 35f92f2ae85e429336d30ed873e198eec57ce05e Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Thu, 16 Aug 2018 17:02:06 -0500 Subject: [PATCH] more DRY re: config --- lib/pipeline/webpackProcess.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/pipeline/webpackProcess.js b/lib/pipeline/webpackProcess.js index 27f364e7c..3bd700b91 100644 --- a/lib/pipeline/webpackProcess.js +++ b/lib/pipeline/webpackProcess.js @@ -50,13 +50,12 @@ class WebpackProcess extends ProcessWrapper { let config, configPath; try { if (fs.existsSync(dappConfigPath)) { - delete require.cache[dappConfigPath]; configPath = dappConfigPath; - config = require(dappConfigPath); + delete require.cache[configPath]; } else { configPath = defaultConfigPath; - config = require(defaultConfigPath); } + config = require(configPath); // valid config types: https://webpack.js.org/configuration/configuration-types/ // + function that returns a config object // + function that returns a promise for a config object