nx/docs/shared/deprecated/workspace-executors.md
Isaac Mann 61436a64ef
docs(core): inferred targets (#21167)
Co-authored-by: Katerina Skroumpelou <mandarini@users.noreply.github.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
Co-authored-by: Victor Savkin <mail@vsavkin.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-02-03 00:14:05 -05:00

924 B

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 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:
npm add -D @nx/plugin
nx g @nx/plugin:plugin 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.
nx generate @nx/plugin:executor my-executor --project=my-plugin
  • 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:

{
  "executor": "@my-org/my-plugin:my-executor"
}