✅ 项目大小已从 80GB 降至 0.7GB
cd yss-project
.\clean-cache.ps1
功能:
# 清理 .angular 和 dist
npm run clean
# 仅清理 .angular 缓存
npm run clean:cache
# 仅清理 dist 构建输出
npm run clean:build
# 清理所有(包括 node_modules)
npm run clean:all
# 删除 .angular 缓存
Remove-Item -Path ".angular" -Recurse -Force
# 删除 dist 构建输出
Remove-Item -Path "dist" -Recurse -Force
cd yss-project
# 检查总大小
$totalSize = (Get-ChildItem -Recurse | Measure-Object -Property Length -Sum).Sum / 1GB
Write-Host "项目总大小: $([math]::Round($totalSize, 2)) GB"
# 检查各文件夹
Get-ChildItem -Directory | ForEach-Object {
$size = (Get-ChildItem $_.FullName -Recurse | Measure-Object -Property Length -Sum).Sum / 1GB
"$($_.Name): $([math]::Round($size, 2)) GB"
}
.angular/ - 构建缓存dist/ - 构建输出coverage/ - 测试覆盖率node_modules/ - 除非要重新安装src/ - 源代码.git/ - 版本控制建议每月清理一次:
npm run clean:cache
.angular文件夹是Angular CLI的构建缓存,累积到了79.84GB。
正常大小: < 500MB
异常大小: > 5GB
优化完成: 2025-11-02
节省空间: 79.3 GB
详细文档: PROJECT-SIZE-OPTIMIZATION.md