-
Notifications
You must be signed in to change notification settings - Fork 21
Does this plugin work with yarn workspaces monorepos? #17
Comments
@50bbx I use this plugin with a monorepo for learnwithjason.dev! I have the I haven't worked with Lerna much, but it should be possible for sure! |
hi I also tried this plugin in a monorepo, and it seems to work fine, as it caches assets relative to the publish dir, it's able to understand it should cache a workspace package .cache and /public However I have a problem with monorepo and this plugin. It's not totally related to this plugin though but more about monorepo support in Netlify. How to handle a monorepo where you have like, 2 sites instead of 1, and don't necessarily want this plugin (or other config put at the workspace root) to apply to all sites? Is there any way to have a single deployment root (the workspace root), and have 2 different netlify toml configs, one for each site, without sharing the build plugins between the 2 deployments? Let's take your own website @jlengstorf, how would you do if you had also a storybook to deploy in this workspace? Note using basedir = ./site + toml in subpackage would not work, as Netlify would not understand it's a yarn workspace and actually try to resolve |
@slorber My intuition would be set a different base directory (matching the workspace directory) for each Netlify Site and have a different However, if I understood correctly, it seems like this configuration might not work for you based on your comment:
Could you please elaborate on this? Yarn should be used, not npm, providing there is a |
The problem is exactly that: with yarn workspaces, there is not a |
you can create an empty yarn.lock in the directories that need to build — it won't cause issues with the monorepo, which will ignore it, and Netlify uses the presence of the lockfile to determine with package manager to use it's kinda hacky, but it will work |
@50bbx Does the workaround suggested by @jlengstorf works for your use case? It seems to me this is a more general issue about Yarn workspaces support inside Netlify, beyond this plugin or the Build plugins beta. Therefore I have opened the following issue to make sure our backend team is involved in improving this use case. If that issue is covering your initial problem, please feel free to close this issue and continue the discussion on that other repository. Thanks! |
I got a similar issue using a
My project under When using the cache plugin it tries somehow to look for Redeploying with clearing the cache in netlify results in a succesful deployment which means that the cache is the problem in this case. Do you have any suggestions for me of how to fix that? |
this issue is beyond the scope of this plugin. I'll be following netlify/build-image#399 and we'll verify upstream fixes once they're merged |
Hi @sidyes looks like the correct way to reference local dependencies in I was able to set up this plugin successfully in this repo https://github.com/erezrokah/gatsby-lerna-repo with |
I have a monorepo managed with Lerna and yarn with a package that is my frontend (which uses Gatbsy) and another that is my CMS (Sanity Studio) both deployed on Netlify.
Here's my
lerna.json
just for referenceA
andB
packages are just dependencies of thefrontend
package.I tried to think about where should I put my
netlify.toml
which I didn't need until now. It would look just like this:Do you have any suggestions on where I should put my
frontend
netlify.toml
?The text was updated successfully, but these errors were encountered: