Hi referring to this re…

2 minute read

Hi, referring to this repository https://github.com/nrwl/nx-incremental-large-repo If I would replace: "tasksRunnerOptions": { "default": { "runner": "@nrwl/nx-cloud", "options": { "accessToken": "YWM3NWZiNmItZWUzMS00ZmMyLWJlODQtZGFlNGMxN2I5NmVlfHJlYWQtd3JpdGU=", "cacheableOperations": ["build", "test", "lint", "e2e"] } } } For that: "tasksRunnerOptions": { "default": { "runner": "@nrwl/workspace/tasks-runners/default", "options": { "cacheableOperations": ["build", "test", "lint", "e2e"] } } } Is any difference in use? nrwl/nx-incremental-large-repo


first one is a distributed cache - meaning that everyone who gets the same code, wont have to rebuild twice. CI’s, work mates, etc

second one is local to your machine only

In the local option, I must first build the project before nx serve, whether I run nx serve and it will work automatically?

i dont think serve is cacheable

no, you don’t have to nx build before nx serve

With a local cache, if you run nx build twice on your machine with the same code, the second build will be nearly instantaneous.

With a remote cache, if you run nx build on your machine with code that has run through CI, your build will be nearly instantaneous

Ok, and if I have buildable libraries, how can I use them to speed up nx serve

or I can’t??

I think buildable libraries will also speed up nx serve, but I’m not positive. You’d want to add serve to the cacheableOperations list. would have a better answer on that.

I have about 80 buildable libs and some are “huge” some small. The question is that if I work locally on a given small lib with nx serve and I need the entire application (80 libs) to freely test the given functionality, can I get independent libs from cache ??

yeah something like that

I am looking for how to improve the work of the developer. Because rebuilding the application locally takes about 17-30 seconds. This is one application that uses all these libraries. At the moment, I can’t split the App into smaller applications and I’m looking for another solution if it exists.

in your blog post on distributed caching, you mention this option "runner": "@nrwl/workspace/src/tasks-runner/tasks-runner-v2", Which one is the right one to use now?

I’m not sure but In last update v2 is default @nrwl/workspace/src/tasks-runner/tasks-runner-v2 === @nrwl/workspace/src/tasks-runner/tasks-runner

Not that one. You can omit the runner option and it will use the latest version

I should update the post

So this "tasksRunnerOptions": { "default": { "options": { "cacheableOperations": ["build", "test", "lint", "e2e"] } } } will use local caching with default runner?


in the latest version of Nx