Why Nx?
We created Nx because developers struggle to configure, maintain and especially integrate various tools and frameworks efficiently. Setting up a system that works well for a handful of developers and at the same time easily scales up to an entire organization can be tricky. This includes setting up low-level build tooling, configuring CI properly, and keeping your codebase healthy, up-to-date, and maintainable as you add features.
We wanted to remove that pain and provide a solution that is easy to adopt and scales.
How Does Nx Help You?
In a nutshell, Nx helps to: a) speed up your computation (e.g. builds, test, lint,.. runs etc), locally and on CI and b) to integrate and automate your tooling via its plugins. All of this can be adopted incrementally. You can, but you don't have to use plugins. Look at the Nx architecture in the next section to learn more.
You can use Nx to
- speed up your existing project's build/test/lint/...times, locally and on CI (whether that's a monorepo or standalone application)
- quickly scaffold a new project (using Nx plugins) without having to worry too much about the lower-level developer tooling setup
- easily integrate new tooling via Nx plugin generators, such as Storybook, Tailwind,...
- automate your existing project with custom code generators
- keep a healthy codebase using dedicated lint rules
- take care of your tooling upgrades using an automated code migration feature
How Does Nx Work?
Nx is built in a modular fashion from the ground up, allowing you to use only the features you need.
Let us take a look at the different parts of the architecture:
- Nx - The very core of Nx contains the fundamental capabilities of Nx, such as workspace analysis, running tasks, caching, distribution, code generation and automated code migrations. All of this is bundled into the
nx
NPM package that can be installed and used in any project or monorepo to run and cache tasks. - Plugins - Nx plugins are NPM packages that extend Nx's capabilities by providing code generators, executors (to abstract lower-level build tooling) and automated code migrations for keeping your tools up to date. Plugins are technology specific, like
@nrwl/react
adds support for React,@nrwl/next
for Next or@nrwl/cypress
adds e2e testing capabilities with Cypress. The goal is to make developers more productive with a given technology via automation and better integrating with other tooling. There are core plugins provided by the Nx team for Angular, React, Next, Remix, Jest, Cypress, Storybook and more as well as more than 80 community plugins. - Devkit - The Nx Devkit provides a set of utilities to help you build your own plugins. This is what the Nx core plugins as well as community plugins are built on. You can use the
@nrwl/nx-plugin
package to easily scaffold a new plugin or even just automate your local workspace. - Editor Extensions - Nx ships a dedicated extension for VSCode, IntelliJ and VIM: Nx Console. Nx Console provides code autocompletion in configuration files and comes with a set of commands to help you run tasks and generate code. Ideal if you're new to Nx and want to discover new features interactively rather than browsing docs.