stefanpenner / hash-for-dep

7 stars 11 forks source link

Use node module resolution to identify a packages base path. #42

Closed rwjblue closed 7 years ago

rwjblue commented 7 years ago

Previously, we were attempting to resolve a directory (hence the inversion of isFile flag to resolve.sync) in an attempt to address packages that had no entry point (e.g. things like @types). Unfortunately, that leaves us prone to large issues with (at least) npm@5 because it will leave empty directories "laying around" during its npm graph building (e.g. when hoisting a package up from a nested location, it may leave the nested directory present but with no files).

This commit changes: