What Are Nx Plugins?
Nx plugins help developers use a tool or framework with Nx. They allow the plugin author who knows the best way to use a tool with Nx to codify their expertise and allow the whole community to reuse those solutions.
For example, plugins can accomplish the following:
- Configure Nx cache settings for a tool. The
@nx/webpack
plugin can automatically configure the inputs and outputs for abuild
task based on the settings in thewebpack.config.js
file it uses. - Update tooling configuration when upgrading the tool version. When Storybook 7 introduced a new format for their configuration files, anyone using the
@nx/storybook
plugin could automatically apply those changes to their repository when upgrading. - Set up a tool for the first time. With the
@nx/playwright
plugin installed, you can use the@nx/playwright:configuration
code generator to set up Playwright tests in an existing project. - Run a tool in an advanced way. The
@nx/js
plugin's@nx/js:tsc
executor combines Nx's understanding of your repository with Typescript's native batch mode feature to make your builds even more performant.
Plugin Features
Infer tasks
Automatically configure Nx settings for tasks based on tooling configuration
Generate Code
Generate and modify code to set up and use the tool or framework
Maintain Dependencies
Automatically update package versions and tooling configuration
Enhance Tooling with Executors
Run a tool in an advanced way that may not be possible from the command line