nx/docs/shared/deprecated/runtime-cache-inputs.md
Isaac Mann 195e1824fc
docs(core): list version for runtime input (#23456)
Specifies which version of Nx allows `runtime` inputs to be listed in
the `inputs` property.

Fixes #17594
2024-05-16 15:44:07 -04:00

920 B

runtimeCacheInputs

The runtimeCacheInputs property was used as a way to add extra inputs to the Nx cache, like the version of node on that particular machine.

runtimeCacheInputs were set as follows:

{
  "tasksRunnerOptions": {
    "default": {
      "runner": "nx/tasks-runners/default",
      "options": {
        "cacheableOperations": ["build", "lint", "test", "e2e"],
        "runtimeCacheInputs": ["node -v"]
      }
    }
  }
}

Instead of specifying the runtime inputs in tasksRunnerOptions, in Nx 14.4 you can include them as runtime inputs in the standard inputs and namedInputs area of your project configuration or nx.json.

The new style looks like this:

{
  "targets": {
    "build": {
      "inputs": ["^build", { "runtime": "node -v" }]
      // ...
    }
  }
}