fix(lib/modules/finders/lookup): do not null cache if modules are found in lookupModules
This commit is contained in:
parent
feee9f7656
commit
b1e293325a
1 changed files with 5 additions and 5 deletions
|
|
@ -110,7 +110,7 @@ export function lookupModules<
|
|||
>(filter: F, options: O): Generator<LookupModulesResult<F, O>, undefined>
|
||||
|
||||
export function* lookupModules(filter: Filter, options?: LookupModulesOptions) {
|
||||
let warn = true
|
||||
let notFound = true
|
||||
|
||||
const reg = cache[filter.key]
|
||||
// Return early if previous lookup was a full lookup and no modules were found
|
||||
|
|
@ -146,7 +146,7 @@ export function* lookupModules(filter: Filter, options?: LookupModulesOptions) {
|
|||
const exports = getInitializedModuleExports(id)
|
||||
const flag = runFilter(filter, id, exports, options)
|
||||
if (flag) {
|
||||
warn = false
|
||||
notFound = false
|
||||
yield [exportsFromFilterResultFlag(flag, exports, options), id]
|
||||
}
|
||||
}
|
||||
|
|
@ -157,7 +157,7 @@ export function* lookupModules(filter: Filter, options?: LookupModulesOptions) {
|
|||
|
||||
const flag = runFilter(filter, id)
|
||||
if (flag) {
|
||||
warn = false
|
||||
notFound = false
|
||||
yield [
|
||||
exportsFromFilterResultFlag(
|
||||
flag,
|
||||
|
|
@ -170,9 +170,9 @@ export function* lookupModules(filter: Filter, options?: LookupModulesOptions) {
|
|||
}
|
||||
|
||||
if (__BUILD_FLAG_DEBUG_MODULE_LOOKUPS__)
|
||||
if (warn) warnDeveloperAboutNoFilterMatch(filter)
|
||||
if (notFound) warnDeveloperAboutNoFilterMatch(filter)
|
||||
|
||||
cache[filter.key] = null // Full lookup, and still not found!
|
||||
if (notFound) cache[filter.key] = null // Full lookup, and still not found!
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue