Apologies for reviving an old post, but this discussion seems highly relevant to my issue, and I thought it would be better to continue here rather than creating a new thread.
We recently converted our project to a monorepo using Turborepo, and we’re running into an issue with the ReScript package. This package is being used by several TypeScript packages in the monorepo, and we can’t seem to cache its build properly.
Here’s the main problem:
Turborepo doesn’t cache builds for dependencies located in node_modules (as pointed out by @KidkArolis).
Since the ReScript package can’t be cache it always compiles, any package depending on it has to be rebuilt every time, even if nothing has changed.
This results in unnecessary rebuilds for every package that uses the ReScript package, slowing down our workflow.
Seems like a real problem for some project to create some rescript package inside monorepos using turbo if all packages depending on one rescript package has to be rebuild
Has anyone found a workaround or solution to cache the ReScript package build more efficiently in this setup?
Yes, we don’t use it (some hacks on our side that aren’t well supported and don’t have time to address for now), but I think it will also build dependencies (like webapi …) inside node_modules, so if you use the package inside another javascript package you can’t rely on the turbo cache