GithubHelp home page GithubHelp logo

nx-mono's Introduction

name slug description framework useCase css deployUrl demoUrl relatedTemplates
Monorepo with Nx
monorepo-nx
Learn to implement a monorepo with a single Next.js site using Nx.
Next.js
Documentation
CSS
monorepo-turborepo
turborepo-next-basic
turborepo-sveltekit-starter

Nx Monorepo

This is a monorepo example using Nx and a single Next.js site in ./apps/app.

Demo

https://solutions-nx-monorepo.vercel.sh

How to Use

You can choose from one of the following two methods to use this repository:

One-Click Deploy

Deploy the example using Vercel:

Deploy with Vercel

Getting Started

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example https://github.com/vercel/examples/tree/main/solutions/nx-monorepo nx-monorepo
yarn create next-app --example https://github.com/vercel/examples/tree/main/solutions/nx-monorepo nx-monorepo
pnpm create next-app --example https://github.com/vercel/examples/tree/main/solutions/nx-monorepo nx-monorepo

Development server

Run npx nx serve app for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build

Run npx nx build app to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run npx nx test app to execute the unit tests via Jest.

Run npx nx affected:test to execute the unit tests affected by a change.

Code scaffolding

Run nx g @nrwl/react:component my-component --project=app to generate a new component.

Generate an application

Run npx nx g @nrwl/react:app new-app to generate an application.

You can use any of the plugins above to generate applications as well.

When using Nx, you can create multiple applications and libraries in the same workspace.

Generate a library

Run npx nx g @nrwl/react:lib my-lib to generate a library.

You can also use any of the plugins above to generate libraries as well.

Libraries are shareable across libraries and applications. They can be imported from @with-nx/mylib.

Further help

Visit the Nx Documentation to learn more.

Nx Cloud

This example is configured to work out of the box with Nx Cloud. However, if deploying an existing project to Vercel - ensure:

If using @nrwl/[email protected] or above

  1. Set NX_CACHE_DIRECTORY=/tmp/nx-cache

If using @nrwl/[email protected] or below

  1. Set NX_CACHE_DIRECTORY=/tmp/nx-cache
  2. Set the cacheDirectory option for the @nrwl/nx-cloud runner in your nx.json to match the value of the NX_CACHE_DIRECTORY environment variable:
"runner": "@nrwl/nx-cloud",
"options": {
  // this must be the same value as `NX_CACHE_DIRECTORY`
  "cacheDirectory": "/tmp/nx-cache"
}

Visit Nx Cloud to learn more.

nx-mono's People

Contributors

zbndm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.