more DRY re: config

This commit is contained in:
Michael Bradley, Jr 2018-08-16 17:02:06 -05:00
parent 04fcb1510a
commit 35f92f2ae8
1 changed files with 2 additions and 3 deletions

View File

@ -50,13 +50,12 @@ class WebpackProcess extends ProcessWrapper {
let config, configPath; let config, configPath;
try { try {
if (fs.existsSync(dappConfigPath)) { if (fs.existsSync(dappConfigPath)) {
delete require.cache[dappConfigPath];
configPath = dappConfigPath; configPath = dappConfigPath;
config = require(dappConfigPath); delete require.cache[configPath];
} else { } else {
configPath = defaultConfigPath; configPath = defaultConfigPath;
config = require(defaultConfigPath);
} }
config = require(configPath);
// valid config types: https://webpack.js.org/configuration/configuration-types/ // valid config types: https://webpack.js.org/configuration/configuration-types/
// + function that returns a config object // + function that returns a config object
// + function that returns a promise for a config object // + function that returns a promise for a config object