I’m using a monorepo model with lerna to manage all the packages we publish on NPM.
Some of those packages are React components or other web-related things where we’d like to publish an ‘example’ on Netlify.
I would prefer to have all configuration handled in code, so we don’t have to go into the Netlify UI every time a new package is added. We could use a netlify.toml file for this, but that seems to come with some limitations:
- While we can create different ‘contexts’ if I understand correctly, they are always tied to a branch?
- Things like headers and redirects seem to apply to all contexts
Essentially, a netlify.toml site applies to one ‘site’. What we’re hoping to do is deploy multiple sites from the same repo.
Short of going into the Netlify UI and configuring multiple sites for the same repo, what would be the best way to handle this?
- Should we deploy from cli rather than use CI?
- Is there a way to have multiple netlify.toml files in repo subfolders and have them picked up somehow?
- Some other way?
If anyone has any experience with monorepos hosting multiple sites, or just thoughts or opinions on the matter, I’d be thankful for your feedback.