LinuxmacOSWindows

Where Does Gleam Put Build Files and Cached Packages?

Gleam builds into a build folder in each project and caches Hex packages in the OS cache directory.

Last updated

Gleam keeps project outputs inside the project. Compiled artifacts, downloaded dependencies, docs, and shipment bundles all land under <project>/build, next to gleam.toml and manifest.toml. Deleting build is always safe. The next compile rebuilds it.

Shared downloads live outside the project in a global cache: ~/.cache/gleam on Linux, ~/Library/Caches/gleam on macOS, %LOCALAPPDATA%\gleam on Windows. Upgrading Gleam invalidates old artifacts via a version fingerprint, so a weird build after an upgrade usually just needs a clean rebuild.

Where Gleam stores this, by platform

Linux
~/.cache/gleam

Global Hex package tarballs under hex/hexpm/packages. Project outputs stay in <project>/build regardless of OS.

macOS
~/Library/Caches/gleam

Same global cache layout. Project build/ holds per-target outputs for Erlang and JavaScript.

Windows
%LOCALAPPDATA%\gleam

Standard Windows cache dir plus gleam. Project build/ layout is identical across platforms.

Frequently asked questions

How do I clean a Gleam project's build outputs?

Delete the build directory at the project root. Dependencies re-download from the cache or the network on the next build, so nothing is lost.

Where are my Gleam dependency downloads cached?

In the global cache (hex/hexpm/packages beneath the paths above). Projects reference them from build/packages. Clearing the cache forces fresh downloads next compile.

Notice an outdated path? Let us know.