From 7fb317e96f5a886709c39a38809eac90b0ebd206 Mon Sep 17 00:00:00 2001 From: Ben Mares <15216687+maresb@users.noreply.github.com> Date: Sun, 25 Oct 2020 17:06:31 +0100 Subject: [PATCH] Fix typo which prevents clearing cached config Closes #84 --- tasks/util/util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/util/util.js b/tasks/util/util.js index 3a5393e..c26fb55 100644 --- a/tasks/util/util.js +++ b/tasks/util/util.js @@ -25,8 +25,9 @@ const getConfigsForDir = (rootDir, configFileName) => { let current = null; let confItems; - delete require.cache[require.resolve(rootDir, confPath)]; // NB: For 'watch' to properly work, the cache needs to be deleted before each require. - current = require(path.resolve(rootDir, confPath)); + const resolvedPath = path.resolve(rootDir, confPath); + delete require.cache[resolvedPath]; // NB: For 'watch' to properly work, the cache needs to be deleted before each require. + current = require(resolvedPath); // Handle single objects or arrays of configs. if (current && current.length) {