From 1c27a30ab4bed2287f79add206a273432fa4bb81 Mon Sep 17 00:00:00 2001 From: Ben Mares <15216687+maresb@users.noreply.github.com> Date: Fri, 30 Oct 2020 08:33:35 +0100 Subject: [PATCH] Fix typo which prevents clearing cached config (#90) 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) {