Skip to content

Commit

Permalink
don't include root node_modules if no packages are bundled
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 29, 2019
1 parent 63d1e3e commit e3acef6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ const npmWalker = Class => class Walker extends Class {
}

onReaddir (entries) {
if (!this.parent)
entries = entries.filter(e => e !== '.git')
if (!this.parent) {
entries = entries.filter(e =>
e !== '.git' &&
!(e === 'node_modules' && this.bundled.length === 0)
)
}
return super.onReaddir(entries)
}

Expand Down

0 comments on commit e3acef6

Please sign in to comment.