Skip to content

Commit

Permalink
fix: package size no longer includes node modules
Browse files Browse the repository at this point in the history
  • Loading branch information
gabidobo committed Jan 22, 2023
1 parent 124b262 commit 3f4e463
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/files/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ const loadInstalledPackages = async (rootPath, subPath = '') => {

if (packageAtRootData) {
try {
packageAtRootData.size = await getFolderSize(currentPath);
let totalSize = await getFolderSize(currentPath);
const modulesPath = path.join(currentPath, 'node_modules');
if (fs.existsSync(modulesPath)) {
totalSize -= await getFolderSize(modulesPath);
}
packageAtRootData.size = totalSize;
// eslint-disable-next-line no-empty
} catch (error) {}
}
Expand Down

0 comments on commit 3f4e463

Please sign in to comment.