diff --git a/lib/util/customConfig.js b/lib/util/customConfig.js index 1ab15994..bf7aadcf 100644 --- a/lib/util/customConfig.js +++ b/lib/util/customConfig.js @@ -36,9 +36,11 @@ function requireUncached(module) { /** * Load the config from a path string or parsed from an object * @param {string|Object} config + * @param {object} options + * @param {boolean} options.newConfig when the config has a different path we must resolve even if mtime is the same * @returns `null` when unchanged, `{}` when not found */ -function loadConfig(config) { +function loadConfig(config, options) { let loadedConfig = null; if (typeof config === 'string') { const resolvedPath = path.isAbsolute(config) ? config : path.join(path.resolve(), config); @@ -48,7 +50,7 @@ function loadConfig(config) { if (stats === null) { // Default to no config loadedConfig = {}; - } else if (lastModifiedDate !== mtime) { + } else if (options.newConfig || lastModifiedDate !== mtime) { // Load the config based on path lastModifiedDate = mtime; loadedConfig = requireUncached(resolvedPath); @@ -88,7 +90,7 @@ function resolve(twConfig) { if (newConfig || expired) { previousConfig = twConfig; lastCheck = now; - const userConfig = loadConfig(twConfig); + const userConfig = loadConfig(twConfig, { newConfig }); // userConfig is null when config file was not modified if (userConfig !== null) { mergedConfig = resolveConfig(userConfig);