Skip to content
pbb.io/blog

TIL Mix supports sparse checkouts for git dependencies

January 15, 2023
1 min read
Elixir

If you only need a single directory from a git repository as a dependency, Mix supports sparse checkouts via the :sparse option. Phoenix uses this to pull in only the optimised SVGs from the heroicons repo:

{:heroicons,
 github: "tailwindlabs/heroicons",
 tag: "v2.0.13",
 sparse: "optimized",
 app: false,
 compile: false,
 depth: 1}

This clones the repository but only checks out the optimized directory, skipping all the source SVGs and build tooling you don’t need.

—

Back to posts

Elixir
Phil-Bastian Berndt

Phil-Bastian Berndt
Tech Lead at Naymspace