Tips and tricks

Various tips and tricks for using Nx.

Convert from a Standalone Repository to a Monorepo

Learn how to transform your standalone Nx repository into a full monorepo structure by moving your root-level application into the apps directory.

Keep Nx Versions in Sync

Learn how to ensure all Nx plugins in your repository are using the same version to avoid compatibility issues and debugging challenges.

Define Environment Variables

Learn how to set and use environment variables in Nx projects, including file-based configuration, custom env files, and ad-hoc variable definition across different operating systems.

Configuring Browser Support

Learn how to configure browser compatibility for your Nx applications using browserslist, optimize bundle size with modern browser targets, and debug your browser support configuration.

Include Assets in Build

Learn how to configure Nx executors to include and copy assets into your output bundle using regex patterns or object format for precise control.

Include All package.json Files as Projects

Learn how to configure Nx to include all package.json files as projects in your workspace graph, not just those referenced in workspaces configuration.

Identify Dependencies Between Folders

Learn how to analyze and visualize dependencies between folders in your Nx workspace to help identify which code should be extracted into separate libraries.

Disable Graph Links Created from Analyzing Source Files

Learn how to configure Nx to only use dependencies defined in package.json instead of detecting dependencies from source code analysis.

Altering Migration Process

Learn advanced techniques for updating Nx and workspace dependencies, including step-by-step migration strategies, managing complex updates, and troubleshooting common issues.

Using Yarn PnP

Learn how to configure and use Yarn Plug'n'Play (PnP) in your Nx workspace to improve installation speed, reduce disk usage, and enforce dependency constraints.