TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nrwl/nx/llms.txt
Use this file to discover all available pages before exploring further.
@nx/node plugin adds Node.js support to your Nx workspace. It provides generators for scaffolding Node applications and libraries, with built-in support for popular frameworks like Express, Fastify, and NestJS. Applications can be built with esbuild or webpack.
Installation
What the plugin provides
Generators
Scaffold Node.js applications, libraries, and Docker configurations.
Framework support
Generate Express, Fastify, and NestJS applications with optional framework boilerplate.
Docker integration
Add Docker configuration to any Node.js project with the
setup-docker generator.Generators
application
Create a new Node.js application.library
Create a Node.js library that can be shared across your workspace.setup-docker
Add aDockerfile and Docker Compose configuration to an existing Node.js project.
Dockerfile that:
- Uses a multi-stage build to keep the final image small
- Copies only the built output and required
node_modules - Runs the application as a non-root user
Inferred tasks
@nx/node delegates build and serve targets to @nx/js, @nx/esbuild, and @nx/webpack depending on the chosen bundler. Tasks are inferred from the build tool’s configuration file when the corresponding plugin is registered in nx.json.
Configuration examples
project.json for an Express app (esbuild)
Docker setup
After runningsetup-docker, serve the application in a container:
Running tasks
Working with NestJS
For full NestJS support, use@nx/nest which extends @nx/node with NestJS-specific generators for modules, controllers, services, guards, pipes, and interceptors.
