Repository files navigation
Quick Start & Documentation
Adding capabilities to your workspace
Nx supports many plugins / add capabilities
React
npm install --save-dev @nx/react
Web (no framework frontends)
npm install --save-dev @nx/web
Angular
npm install --save-dev @nx/angular
Nest
npm install --save-dev @nrwl/nest
Express
npm install --save-dev @nrwl/express
Node
npm install --save-dev @nrwl/node
Via some plugin
Example: nx g @nx/react:app my-app
multiple applications & libraries / same workspace, can be created
Via some plugin
Example: nx g @nx/react:lib my-lib
are shareable
importing them -- Example: @nx-example/mylib --
across -- Example: Check 'cart' in the 'dep-graph' --
nx serve SomeAppName -- Example: nx serve products --
start dev server
hot reload
== if you change any of the source files -> The app will automatically reload
nx g @nx/react:component my-component --project=SomeProjectName
nx build SomeProjectName -- Example: nx build products--
build the project
build artifacts
--prod
nx test SomeProjectName -- Example: nx test products --
execute unit tests -- via -- Jest
⚠️ NOT all projects have a test task configured ⚠️
Example:_ nx test products-e2e
nx run-many -t test
execute target test / 👁️ALL projects with that target 👁️
nx run-many -t test -p products
execute target test / ⚠️ project 'product' ONLY ⚠️
nx affected:test
execute the unit tests / affected by a change
nx e2e SomeProjectName -- Example: nx e2e products-e2e --
execute the end-to-end tests -- via -- Cypress
nx show projects
list the projects / exist in the current Nx workspace
⚠️ NOT all projects have an e2e task configured ⚠️
nx affected:e2e
execute the end-to-end tests / affected projects by a change
Understand your workspace
npm install --force
nx dep-graph
see a diagram of the dependencies of your projects
Display the available tasks / project
Note: 🧠 NO sense, because tasks are INVOCATIONS -- Check glossary -- 🧠
Display the available targets / project
Attempts:
Attempt1: nx list target SomeProjectName
Attempt3: nx show projects --affected --target=build --all / nx show projects --affected
Solution: nx show project projectName -- nx show project products -- Or via Nx Console
About
Example repo for Nx workspace
Resources
Stars
Watchers
Forks
Languages
TypeScript
91.5%
SCSS
4.0%
HTML
2.9%
JavaScript
1.6%
You can’t perform that action at this time.