Skip to content
GitHubBlueskydev.toRSS

12Compare

vx vs Nx

Coming from Nx? One command turns your Nx graph into vx config.

Terminal window
bunx @vzn/vx init --native
Read

Here is the same build target, before and after:

nx.json + project.json

"build": {
"executor": "nx:run-commands",
"options": {
"command": "vite build"
},
"dependsOn": ["^build"],
"inputs": [
"{projectRoot}/src/**/*",
"{projectRoot}/vite.config.ts"
],
"outputs": [
"{projectRoot}/dist"
],
"cache": true
}

packages/web/vx.config.ts

build: {
exec: { command: 'vite build' },
dependsOn: ['^build'],
inputs: {
files: ['src/**/*', 'vite.config.ts'],
},
outputs: { files: ['dist'] },
cache: true,
},

Look at exec.command: vx spawns vite build itself. No Node process boots per task, and no daemon runs.

Both tools ran the same graph, the same commands, at the same concurrency. Shorter bars mean less waiting on the tool.

Nothing changed
vx530 ms
Nx11.53 s
Nothing changed, outputs restored
vx1.07 s
Nx11.49 s
Cold build
vx6.66 s
Nx2 min 57 s
Cold build: CPU the runner burns
vx42.65 s
Nx5 min 20 s
The table
Time added over the ideal run, 1,601 projects, 9,603 tasks vx Nx
Nothing changed 530 ms 11.53 s
Nothing changed, outputs restored 1.07 s 11.49 s
Cold build 6.66 s 2 min 57 s
Cold build: CPU the runner burns 42.65 s 5 min 20 s

Measured: vx 0.0.0 @ 31607fb13 on 2026-11-23, Turbo 2.11.13 on 2026-11-23, Nx 24.0.6 on 2026-11-23, Vite Task 1.7.0 on 2026-11-23; linux x64, 4 cores (AMD EPYC 7763 64-Core Processor), 16 GB.

You can now read each bar as the time the tool itself costs you on 9,603 tasks.

DetailsHow it is measured

Workload. A synthetic monorepo of 1,601 projects and 9,603 tasks in 30 dependency levels. Five core libraries are used by a quarter of the projects.

Task times. Build 300 ms, test and typecheck 150 ms, lint 75 ms, publish 30 ms. Real repos with uneven task times differ.

Config. Each tool runs its own native config. Every Nx task is an nx:run-commands target running the same command vx runs.

Nx settings. The daemon is off, as in CI. .env loading is off (NX_LOAD_DOT_ENV_FILES=false), which makes Nx faster here than its default.

Why off? In a separate check of this graph, the daemon made a nothing-changed run slower, not faster (Nx 24.0.6, 4-core Linux, best of three, 2026-11-23).

The full method is on Benchmarks.

Sandbox, flaky tasks and run history on your machine

Section titled “Sandbox, flaky tasks and run history on your machine”

Nx offers these three through Nx Cloud. vx runs them locally, with no account.

You want Nx vx
A task kept to the files it declared Sandboxing on Nx Cloud exec.sandbox, local
Flaky tasks flagged Nx Cloud Local: the same key failed after it passed
Past runs to look back on Nx Cloud vx last replays any run; vx why names what moved

A sandboxed task that reads a file it did not declare fails. A failed task is never cached.

Check yourself A sandboxed task reads ../../.env, which it never declared. What happens?

The read is out of its reach, so the task fails and nothing is cached. You either add the file to the task’s inputs, or stop reading it.

You can now get sandboxing, flaky detection and run history with no account.

A shared cache a pull request cannot poison

Section titled “A shared cache a pull request cannot poison”

With vx, the cache server decides where a write lands. Your CI’s OIDC token, checked against the server’s trust policy, names the branch.

So a pull request writes only its own entries (on GitHub, its merge ref). It reads those first, then its branch’s, then main’s (security model).

This blocks cache poisoning such as CVE-2025-36852, where a pull request plants bytes main later replays.

You can now share one cache between main and pull requests without trusting every pull request.

DetailsFeature by feature
Feature vx Nx
Config TypeScript, evaluated into the cache key JSON (project.json, nx.json), plus inferred targets
Daemon None; nothing boots per task On by default locally
Outputs on run and restore Exactly the cached files: no stale file survives a hit Additive
Task sandbox Local, opt-in per task (Linux, macOS), no account An Nx Cloud feature
Remote cache Your own server (vxCache()), Nx’s self-hosted spec (nxCache()), Turbo’s, or Bazel REAPI Nx Cloud or a plugin
Flaky task detection Local: the same key failed after it passed Nx Cloud
Why a task missed vx why names the file, env var or upstream that moved Shows hashes, not the diff
Tasks on other machines Distributed task execution over workers your CI starts Nx Agents on Nx Cloud
Plugins Every stage of a run, 16 hooks; core applies none Inferred tasks, graph data, generators, executors
Other languages JavaScript workspaces Gradle, Maven and .NET
One task, many modes (build:prod) A TypeScript function per mode, two tasks configurations and -c
Terminal output Streamed blocks you can scroll, copy and pipe Terminal UI
Install One binary with Bun inside; Node optional npm and Node

Every row is held in vx vs Turborepo vs Nx, which links each row to its source. How both tools do on one suite of cases is on Conformance.

Pick Nx if one of these decides it for you:

  • Plugins that already know your tools. Nx infers targets from your tool configs (Nx plugins). vx asks you to write each task.
  • JVM or .NET in the same graph (multi-language support). vx runs JavaScript workspaces.
  • CI distribution run for you as a service (Nx Agents). vx’s Distributed task execution runs on workers and servers you own.
  • One task, many modes. Nx’s configurations keep build:prod as one target.
  • A stable release. vx is pre-alpha: 0.0.x on npm, no support policy.

You can now tell whether your workspace is better served by Nx, before you switch.

An Nx workspace moves to vx

1. Run init: it reads the resolved Nx graph

bunx @vzn/vx init --native
$ bunx @vzn/vx init --native
vx-migrate 0.0.0
from nx graph
ran bun add -d @vzn/vx @vzn/vx-lockfile @vzn/vx-history
tasks 6 clean
files packages/ui/vx.config.ts
packages/web/vx.config.ts
.vx/workspace.ts
.vx/.gitignore
lock 2 project configs → .vx/projects.lock, .vx/dependencies.lock
note migrating from the resolved project-graph snapshot — plugin-inferred targets are frozen as static config; `nx:run-commands` targets are their shell lines
Nx caches whichever of a target's outputs exist; vx fails a task when one of its literal output paths matches nothing ("outputs matched no files"; a wildcard may match nothing beside one that matched): 2 tasks declare literal outputs — remove each path its command never writes, or make it a wildcard
next vx run build --all

Read the tasks line: 6 clean. Every target mapped. Each note line names one difference to check.

2. Each package gets its own config

packages/web/vx.config.ts
import type { ProjectConfig } from '@vzn/vx/config'
export default {
tasks: {
build: {
exec: { command: 'vite build' },
dependsOn: ['^build'],
inputs: { files: ['src/**/*', 'vite.config.ts'] },
outputs: { files: ['dist'] },
cache: true,
},
test: {
exec: { command: 'vitest run' },
dependsOn: ['^build'],
inputs: { files: ['src/**/*'] },
outputs: { files: [] },
cache: true,
},
lint: {
exec: { command: 'oxlint' },
inputs: { files: ['src/**/*'] },
outputs: { files: [] },
cache: true,
},
},
} satisfies ProjectConfig

targetDefaults from nx.json landed on each task. {projectRoot}/ is gone: a vx path starts at the package.

3. Run the build with vx

Terminal window
vx run build --all

Run it twice. The second run is all cache hits, as on Caching.

You can now move an Nx workspace to vx and run its build.

PatternsKeep your remote cache and your habits

Declare nxCache() in .vx/workspace.ts. It speaks Nx’s self-hosted /v1/cache spec, so your cache server stays.

vx run takes each Nx flag as it is, rewrites it to vx’s spelling, or refuses it and names the vx way. None is dropped in silence.

vx run web:build, typed the Nx way, is answered with the vx spelling: vx run web#build.

DetailsWhat init cannot map

Anything Nx can say that vx cannot becomes a TODO(vx-migrate) comment in the config, never a silent wrong value.

Targets inferred by Nx plugins are written out as static config. nx:run-commands targets become their shell lines.

Executor targets (@nx/js:tsc, @nx/vite:build) run as themselves, so Nx stays installed until you rewrite each one as the command it runs.

The whole mapping is on Migrate. vx is MIT, with no cloud and no account.

NextQuickstart →Set up a workspace from scratch and run its first cached build.
Turborepo, Nx and other product names are trademarks of their owners. vx is not affiliated with or endorsed by them.