@nx/workspace:move

Move a project to another folder in the workspace.

Usage

1nx generate move ... 2
1nx g mv ... #same 2

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

You can specify the collection explicitly as follows:

1nx g @nx/workspace:move ... 2
Nx 15 and lower use @nrwl/ instead of @nx/

Show what will be generated without writing to disk:

1nx g move ... --dry-run 2

Examples

Move libs/my-feature-lib to libs/shared/my-feature-lib:

1nx g @nx/workspace:move --project my-feature-lib --destination shared/my-feature-lib 2
Nx 15 and lower use @nrwl/ instead of @nx/

Options

destination

Required
string

The folder to move the project into.

projectName

projectRequired
string

The name of the project to move.

newProjectName

project
string
Pattern: (?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$

The new name of the project after the move.

importPath

string

The new import path to use in the tsconfig.base.json.

projectNameAndRootFormat

string
Accepted values: as-provided, derived

Whether to generate the new project name and destination as provided (as-provided) or generate them composing their values and taking the configured layout into account (derived).

updateImportPath

boolean
Default: true

Should the generator update the import path to reflect the new location?

skipFormat

boolean
Default: false

Skip formatting files.