Skip to content

Commit

Permalink
docs(core): add section on migrating all plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKless committed Sep 11, 2024
1 parent 7766837 commit 0c910eb
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions docs/shared/recipes/running-tasks/convert-to-inferred.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ For the best experience, we recommend that you [migrate](/features/automate-upda
npx nx migrate latest
```

## Migrate a Plugin
## Migrate All Plugins

You can use the `infer-targets` generator to quickly migrate all available plugins to use inferred tasks. See the sections below for more details on the individual plugins' migration processes.

```shell
npx nx g infer-targets
```

The generator will automatically detect all available `convert-to-inferred` generators and run the ones you choose. If you only want to try it on a single project, pass the `--project` option.

## Migrate a Single Plugin

Most of the official plugins come with a `convert-to-inferred` generator. This generator will

Expand All @@ -42,7 +52,7 @@ None of the above
For third-party plugins that provide `convert-to-inferred` generators, you should pick the `None of the above` option and type in the name of the package manually. Alternatively, you can also provide the package explicitly with `nx g <plugin>:convert-to-inferred`.
{% /callout %}

We recommend that you migrate the plugins one at a time, and check that the configurations are correct before continuing to the next plugin. If you only want to try it on a single project, pass the `--project` option.
We recommend that you check that the configurations are correct before continuing to the next plugin. If you only want to try it on a single project, pass the `--project` option.

## Understand the Migration Process

Expand Down Expand Up @@ -96,7 +106,7 @@ For example, if we migrated the `@nx/vite` plugin for a single app (i.e. `nx g @
You'll notice that the `serve` and `build` tasks are running the [Vite CLI](https://vitejs.dev/guide/cli.html) and there are no references to Nx executors. Since the targets directly invoke the Vite CLI, any options that may be passed to it can be passed via Nx commands. e.g. `nx serve demo --cors --port 8888` enables CORs and uses port `8888` using [Vite CLI options](https://vitejs.dev/guide/cli.html#options)
The same CLI setup applies to other plugins as well.

- `@nx/cypess` calls the [Cypress CLI](https://docs.cypress.io/guides/guides/command-line)
- `@nx/cypress` calls the [Cypress CLI](https://docs.cypress.io/guides/guides/command-line)
- `@nx/playwright` calls the [Playwright CLI](https://playwright.dev/docs/test-cli)
- `@nx/webpack` calls the [Webpack CLI](https://webpack.js.org/api/cli/)
- etc.
Expand Down

0 comments on commit 0c910eb

Please sign in to comment.