Skip to content

Commit

Permalink
fix(utils): handle undefined entry conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 21, 2020
1 parent a84f31d commit 007c785
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/utils/src/cjs.js
Expand Up @@ -7,11 +7,10 @@ export function clearRequireCache (id) {
try {
entry = require.cache[id]
} catch (e) {
delete require.cache[id]
return
}

if (!entry || isExternalDependency(id)) {
delete require.cache[id]
return
}

Expand All @@ -31,11 +30,10 @@ export function scanRequireTree (id, files = new Set()) {
try {
entry = require.cache[id]
} catch (e) {
files.add(id)
return files
}

if (!entry || isExternalDependency(id) || files.has(id)) {
files.add(id)
return files
}

Expand Down

0 comments on commit 007c785

Please sign in to comment.