Menu

I found 21 GB of build folders hiding inside my projects, including ones nested in other projects
📰

I found 21 GB of build folders hiding inside my projects, including ones nested in other projects

DEV Community: flutter·Anindya Chatterjee·9 days ago
#MJfbZXfS
#devtoflutter#devto#dev#folder#flutter
Long article (470 words) — no AI summary yet.
Reading 0:00
15s threshold

My laptop ran out of space again. Not from photos or videos. From build output.

A target/ in every Rust crate. A node_modules/ in every web project. A build/ and .dart_tool/ in every Flutter app. None of it matters, and all of it comes back the next time I build. One scan of my code folder found 21.5 GB across 8 projects.

The bash script that missed half of it

For a while I used a small script. Walk the code folder, find a project marker ( Cargo.toml , pubspec.yaml , package.json ), run the clean command, move on.

The problem was "move on". The script stopped at the first marker it found. My Flutter apps have a Rust crate inside them ( rust/ , for native code). The script ran flutter clean on the app and never looked inside. The crate's target/ folder sat there, often bigger than the whole app.

That is not Flutter's fault. flutter clean should not touch a folder it does not own.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.