<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior Some plugin docs don't make sense after project name and root changes ## Expected Behavior They've been touched up ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #25191
29 lines
986 B
Markdown
29 lines
986 B
Markdown
# Workspace Executors
|
|
|
|
In Nx 13.10+, local nx plugins can contain executors that are used in the workspace. When creating a custom executor for your workspace, look into the [local executor guide](/extending-nx/recipes/local-executors) to simplify the build process.
|
|
|
|
## Converting workspace executors to local executors
|
|
|
|
- If you don't already have a local plugin, use Nx to generate one:
|
|
|
|
```shell
|
|
npm add -D @nx/plugin
|
|
nx g @nx/plugin:plugin my-plugin --directory=tools/my-plugin
|
|
```
|
|
|
|
- Use the Nx CLI to generate the initial files needed for your executor. Replace `my-executor` with the name of your workspace executor.
|
|
|
|
```shell
|
|
nx generate @nx/plugin:executor my-executor --directory=tools/my-plugin/src/executors/my-executor
|
|
```
|
|
|
|
- Copy the code for your workspace executor into the newly created executor's folder. e.g. `libs/my-plugin/src/executors/my-executor/`
|
|
|
|
- Now you can reference the executor like this:
|
|
|
|
```jsonc
|
|
{
|
|
"executor": "@my-org/my-plugin:my-executor"
|
|
}
|
|
```
|