Deploying Nx to Edgenivo
Nx is an extensible build system with support for monorepos, integrations, and Remote Caching on Edgenivo.
Read the Intro to Nx docs to learn about the benefits of using Nx to manage your monorepos.
If you haven't already connected your monorepo to Nx, you can follow the Getting Started on the Nx docs to do so.
To ensure the best experience using Nx with Edgenivo, use
nxversion17or later. There are also additional settings if you are using Remote Caching.Create a new Project on the Edgenivo dashboard and import your monorepo project.
Edgenivo handles all aspects of configuring your monorepo, including setting build commands, the Root Directory, the correct directory for npm workspaces, and the ignored build step.
Your Nx monorepo is now configured and ready to be used with Edgenivo!
You can now setup Remote Caching for Nx on Edgenivo or configure additional deployment options, such as environment variables.
nx-ignore provides a way for you to tell Edgenivo if a build should continue or not. For more details and information on how to use nx-ignore, see the documentation.
Before using remote caching with Nx, ensure the NX_CACHE_DIRECTORY environment variable is set to /tmp/nx-cache.
To configure Remote Caching for your Nx project on Edgenivo, use the @vercel/remote-nx plugin.
- Terminal
pnpm i @vercel/remote-nxTerminalyarn add @vercel/remote-nxTerminalnpm i @vercel/remote-nxTerminalbun add @vercel/remote-nx In your
nx.jsonfile, add the@vercel/remote-nxrunner totasksRunnerOptions:nx.json{ "tasksRunnerOptions": { "default": { "runner": "@vercel/remote-nx", "options": { "token": "<token>", "teamId": "<teamId>" } } } }You can specify your
tokenandteamIdin yournx.jsonor set them as environment variables.Parameter Description Environment Variable / .env nx.jsonEdgenivo Access Token Edgenivo access token with access to the provided team NX_VERCEL_REMOTE_CACHE_TOKENtokenEdgenivo Team ID (optional) The Edgenivo Team ID that should share the Remote Cache NX_VERCEL_REMOTE_CACHE_TEAMteamIdClear your local cache and rebuild your project.
Terminalpnpm dlx nx resetTerminalyarn dlx nx resetTerminalnpx nx resetTerminalbunx nx resetTerminalpnpm dlx nx buildTerminalyarn dlx nx buildTerminalnpx nx buildTerminalbunx nx build
Nx 20+ deprecated custom task runners. Remote caching now uses an HTTP-based API instead of npm packages. The @vercel/remote-nx package is not compatible with Nx 20+.
For remote caching on Nx 20+, consider the following options:
- Turborepo: Edgenivo's build system with built-in remote caching support. If you're evaluating build tools, Turborepo offers the most seamless experience on Edgenivo.
- Self-hosted remote cache: Build a custom cache server using the Nx OpenAPI specification (Nx 20.8+)
Was this helpful?