-
Notifications
You must be signed in to change notification settings - Fork 196
Yarn workspaces support improvements #399
Comments
I'm having really slow builds due to this issue. I have a large app in This is costing us about 95 seconds of build minutes for every single deploy. |
Hey Having an empty yarn.lock in a sub package seems to work to tell netlify to use Yarn, however I encouter the same issue as @pixelbreaker with Yarn downloading each time dependencies. As dependencies end up being in both root/node_modules + root/packages/mySiteToDeploy/node_modules, it's not totally clear how Netlify handles caching Also, there is a "yarn install --focus" command that we should be able to leverage so that Yarn download only the dependencies for the package we are trying to build. Currently if you have a very large monorepo with a packages having very different dependencies, all dependencies have to be downloaded each time. (see https://classic.yarnpkg.com/blog/2018/05/18/focused-workspaces/) Also, on my personal website (opensource gatsby site, no workspace) I had For monorepo support doesn't it make sense to let the user add himself |
Also something related, but it would be convenient if the netlify support could check parent folders for .nvmrc that specify node version, so that we don't have to put a .nvmrc to each subfolder if the repo use the same node version across all projects (it's more convenient to have one at the monorepo root) |
Hey folks 👋 Seems like the original issue reported by @ehmicky has been fixed meanwhile, users can use the Meanwhile, for the cache related issues with
Unfortunately seems like it's not a straight forward process, as per - yarnpkg/yarn#6715 - focus assumes all the sibling packages are pushed to
That's a good call actually. Mind opening up a separate issue for it? |
I know this is closed but wanted to share an exciting update about Yarn workspaces in case you're still tracking the issue @slorber: we’ve made improvements to how we cache dependencies for these projects. You can try out our new caching by creating an environment variable called We want your feedback before we roll this out more widely- please let us know here or in the forum what your experience is like! You can also read more about this change here: https://answers.netlify.com/t/improved-caching-for-yarn-workspaces/36066 |
For monorepos where each package has its own Netlify Site, we recommend using a different base directory for each of them, and optionally a different
netlify.toml
. At least that's my assumption, please correct me if I'm wrong.The problem is that, when using Yarn workspaces, the
yarn.lock
file will be at the top-level, not inside each package. Because of this, we currently don't detect it and we usenpm
instead ofyarn
.One workaround is to create an empty
yarn.lock
file inside packages directories, but that's hacky.This problem was reported by @50bbx here.
The text was updated successfully, but these errors were encountered: