@nx/workspace:remove

Remove a project from the workspace.

Usage

nx generate remove ...
nx g rm ... #same

By default, Nx will search for remove in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

nx g @nx/workspace:remove ...
Nx 15 and lower use @nrwl/ instead of @nx/

Show what will be generated without writing to disk:

nx g remove ... --dry-run

Examples

Remove my-feature-lib from the workspace:

nx g @nx/workspace:remove my-feature-lib
Nx 15 and lower use @nrwl/ instead of @nx/

Force removal of my-feature-lib from the workspace:

nx g @nx/workspace:remove my-feature-lib --forceRemove
Nx 15 and lower use @nrwl/ instead of @nx/

Options

projectName

projectRequired
string

The name of the project to remove.

forceRemove

boolean
Default: false

When true, forces removal even if the project is still in use.

importPath

string

The library name used at creation time

skipFormat

boolean
Default: false

Skip formatting files.