jen
May 14, 2020, 9:03pm
4
Hey! To be honest, our monorepo support doesn’t support Lerna /Yarn workspaces very well yet and I can’t think of a workaround for your workflow. I’m linking to a few other forum posts that may be helpful though, just in case:
@jen thanks for the response!
I’m not calling yarn because netlify calls yarn for me (instead of npm i when it detects a yarn.lock).
That said, I got some help on this from someone else trying to tackle the same issue (the goal here with the pre-install hook is to improve the unsupported Lerna monorepo node_modules caching to reduce build times), and he pointed out that netlify is calling yarn in the monorepo subdir not the root dir, which I hadn’t thought of. So I think I need to put the prei…
You should be able to put the netlify.toml in each subdir, if the base is configured in the UI, yes.
If you have one in the root that doesn’t have base set, that should be fine. If base is set it in, and doesn’t match what’s in the UI, not sure what would happen (so, don’t set base in that netlify.toml unless you have only one netlify site, is my suggestion).
Does that help?
I will also review this feedback with our documentation team who are working specifically on the monorepo docs this sp…