Mix supports sparse checkouts for git dependencies
January 15, 2023
Mix can do sparse checkouts of git dependencies with the :sparse option. That’s handy if you only need a single directory from a repository. Phoenix uses it to pull in just 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.