@nx/workspace:move
Move a project to another folder in the workspace.
Monorepo World: October 7, 2024Monorepo World: October 7, 2024Join us!
Move a project to another folder in the workspace.
1nx generate move ...
21nx g mv ... #same
2By 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 ...
2Show what will be generated without writing to disk:
1nx g move ... --dry-run
2Move libs/my-feature-lib to libs/shared/my-feature-lib:
1nx g @nx/workspace:move --project my-feature-lib --destination shared/my-feature-lib
2The folder to move the project into.
The name of the project to move.
(?:^@[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.
The new import path to use in the tsconfig.base.json.
as-provided, derivedWhether 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).
trueShould the generator update the import path to reflect the new location?
falseSkip formatting files.
Join us live for exciting talks on developer tooling and monorepos! Catch the action on YouTube and join the conversation on Discord!