Skip to content

Commit fa64e29

Browse files
committed
When populating ExportMap, only load file if it's not ignored
1 parent 112a0bf commit fa64e29

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Diff for: src/ExportMap.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,18 @@ ExportMap.for = function (context) {
310310
return null
311311
}
312312

313+
// check for and cache ignore
314+
if (isIgnored(path, context)) {
315+
log('ignored path due to ignore settings:', path)
316+
exportCache.set(cacheKey, null)
317+
return null
318+
}
319+
313320
const content = fs.readFileSync(path, { encoding: 'utf8' })
314321

315-
// check for and cache ignore
316-
if (isIgnored(path, context) || !unambiguous.test(content)) {
317-
log('ignored path due to unambiguous regex or ignore settings:', path)
322+
// check for and cache unambigious modules
323+
if (!unambiguous.test(content)) {
324+
log('ignored path due to unambiguous regex:', path)
318325
exportCache.set(cacheKey, null)
319326
return null
320327
}

0 commit comments

Comments
 (0)