Example ignore command for Monorepo?

I have been really thankful for the recommended monorepo setup. We’ve adopted that pattern for a monorepo with about 12 sites in it currently.

Towards the bottom is this:

By default, any changes in the base directory (the repository root, by default) trigger a build of all connected sites. If you would like to only trigger site builds when a change occurs in the site’s subdirectory, you can add a custom ignore builds command to the site’s netlify.toml file.

I’m getting hung up on how this works. All sites are rebuilding on any change to any site currently, which is not quite what we want.

Specifically when it says adding a custom netlify.toml file to the site, does it mean to the top level monorepo? Or does each individual site need it’s own netlify.toml file?

If someone has an example of how they are doing this with a monorepo that is exactly like the recommended setup (/apps folder contains each site in a distinct folder), I would be appreciative!

@matt4 The documentation linked shows the netlify.toml is on a per project basis.

Monorepo documentation

Ignore builds documentation


If you think about it, it would have to be, since it’s run independently for the builds and the internal ignore is the system by which each individual project is able to check if it should run, based on what has changed.

:man_facepalming: thank you, somehow I missed that in the screenshot.

1 Like