Fix typo which prevents clearing cached config (#90)

Closes #84
This commit is contained in:
Ben Mares 2020-10-30 08:33:35 +01:00 committed by GitHub
parent 83c3389945
commit 1c27a30ab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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) {