https://github.com/nrwl/nx-incremental
Example showing how to set up incremental builds with Nx
https://github.com/nrwl/nx-incremental
Last synced: 3 months ago
JSON representation
Example showing how to set up incremental builds with Nx
- Host: GitHub
- URL: https://github.com/nrwl/nx-incremental
- Owner: nrwl
- Created: 2020-03-12T14:17:36.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-03T01:58:42.000Z (over 3 years ago)
- Last Synced: 2025-10-01T11:58:53.756Z (3 months ago)
- Language: TypeScript
- Size: 592 KB
- Stars: 4
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Incremental Example
This project has one application and three libraries. If you run `nx dep-graph`, you will see the following:

Run `nx serve ngapp`, and you will see the application built out of libraries and then served. Open `http://localhost:4200` to see the changes.
Make a change to, say, `lib2.module.ts`. You will see that lib2 will be recompiled and the app will be rebundled. But lib1 and lib3 won't be.
Run `nx test ngapp --with-deps` to run all the tests.
If you don't want to rerun everything but instead want to focus on one lib, run: `nx build lib2 --with-deps`
# Trade Offs
1. This repo uses ngpackagr, which isn't the most efficient way to compile libs. It bundles things in different formats. A much faster way to do it should land soon.
2. We aren't using webpack dev server here. It's possible to set it up, but it makes things more complex.