HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

nx — Manage `nx` workspaces. More information: <https://nx.dev/docs/reference/nx-commands>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
httpscommandworkspacesnxclimanageinformationmore

Problem

How to use the nx command: Manage nx workspaces. More information: <https://nx.dev/docs/reference/nx-commands>.

Solution

nx — Manage nx workspaces. More information: <https://nx.dev/docs/reference/nx-commands>.

Build a specific project:
nx build {{project}}


Test a specific project:
nx test {{project}}


Execute a target on a specific project:
nx run {{project}}:{{target}}


Execute a target on multiple projects:
nx run-many --target {{target}} --projects {{project1}},{{project2}}


Execute a target on all projects in the workspace:
nx run-many --target {{target}} --all


Execute a target only on projects that have been changed:
nx affected --target {{target}}

Code Snippets

Build a specific project

nx build {{project}}

Test a specific project

nx test {{project}}

Execute a target on a specific project

nx run {{project}}:{{target}}

Execute a target on multiple projects

nx run-many --target {{target}} --projects {{project1}},{{project2}}

Execute a target on all projects in the workspace

nx run-many --target {{target}} --all

Context

tldr-pages: common/nx

Revisions (0)

No revisions yet.