|
| 1 | +--- |
| 2 | +name: igniteui-angular-build |
| 3 | +description: "Quick-reference for building the core Ignite UI for Angular library and related packages. Covers the full production build (`build:lib`), individual partial builds (styles, extras, migrations, schematics, i18n, elements), and the combined build-all command. Use when an agent needs to compile the library, produce a dist output, or verify that code changes compile cleanly. Do NOT use for running tests — use igniteui-angular-testing instead. Do NOT use for linting — use igniteui-angular-linting instead." |
| 4 | +user-invocable: true |
| 5 | +--- |
| 6 | + |
| 7 | +# Ignite UI for Angular — Build |
| 8 | + |
| 9 | +Quick-reference card for the core library and related build commands in this repository. |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +- Run `npm install` at the repo root before any build command. |
| 14 | + |
| 15 | +## Full Build |
| 16 | + |
| 17 | +```bash |
| 18 | +npm run build |
| 19 | +``` |
| 20 | + |
| 21 | +Runs all sub-builds in sequence (library, elements, schematics, migrations, i18n, extras). Use this when you need a complete publishable output or before running the full CI pipeline locally. Check `package.json` for the exact sequence. |
| 22 | + |
| 23 | +## Library Build (most common) |
| 24 | + |
| 25 | +```bash |
| 26 | +npm run build:lib |
| 27 | +``` |
| 28 | + |
| 29 | +This is the primary build command. It does two things: |
| 30 | + |
| 31 | +1. `ng build igniteui-angular --configuration production` — compiles the library with ng-packagr using Angular Package Format. Uses `ng-package.prod.json` (production config). |
| 32 | +2. `npm run build:styles` — runs `node scripts/build-styles.mjs` to compile and bundle Sass themes into distributable CSS. |
| 33 | + |
| 34 | +**Output**: `dist/igniteui-angular/` |
| 35 | + |
| 36 | +### When to use `build:lib` |
| 37 | + |
| 38 | +- After implementing a feature or fix, to verify the code compiles. |
| 39 | +- Before checking that new public symbols are correctly exported. |
| 40 | +- When another project needs to consume a local build of the library. |
| 41 | + |
| 42 | +## Partial Builds |
| 43 | + |
| 44 | +| Command | What it does | |
| 45 | +|---|---| |
| 46 | +| `npm run build:styles` | Compiles Sass themes only (`scripts/build-styles.mjs`). Already included in `build:lib`. | |
| 47 | +| `npm run build:extras` | Builds the extras package and then runs extras migrations. | |
| 48 | +| `npm run build:schematics` | Copies and compiles `ng add` schematics (`projects/igniteui-angular/schematics/`). | |
| 49 | +| `npm run build:migrations` | Copies and compiles `ng update` migration schematics (`projects/igniteui-angular/migrations/`). | |
| 50 | +| `npm run build:i18n` | Compiles the i18n package (`projects/igniteui-angular-i18n/`). | |
| 51 | +| `npm run build:elements` | Builds the Angular Elements package + bundling + style copy. | |
| 52 | +| `npm run build:docs` | Generates TypeDoc + SassDoc documentation. | |
| 53 | + |
| 54 | +### When to use partial builds |
| 55 | + |
| 56 | +- **`build:schematics`** — after editing files under `projects/igniteui-angular/schematics/`. |
| 57 | +- **`build:migrations`** — after editing files under `projects/igniteui-angular/migrations/`. Required before running `test:schematics`. |
| 58 | +- **`build:extras`** — after editing the extras package or when validating the full root `build` flow. |
| 59 | +- **`build:i18n`** — after changing i18n resource strings. |
| 60 | +- **`build:elements`** — when working on the Angular Elements wrapper. |
| 61 | + |
| 62 | +## Key Paths |
| 63 | + |
| 64 | +| Path | Purpose | |
| 65 | +|---|---| |
| 66 | +| `projects/igniteui-angular/` | Library source root | |
| 67 | +| `projects/igniteui-angular/ng-package.prod.json` | Production ng-packagr config | |
| 68 | +| `projects/igniteui-angular/ng-package.json` | Dev ng-packagr config (preserves dest) | |
| 69 | +| `dist/igniteui-angular/` | Build output | |
| 70 | +| `scripts/build-styles.mjs` | Sass theme compilation script | |
| 71 | + |
| 72 | +## Related Skills |
| 73 | + |
| 74 | +- [`igniteui-angular-testing`](../igniteui-angular-testing/SKILL.md) — Running tests |
| 75 | +- [`igniteui-angular-linting`](../igniteui-angular-linting/SKILL.md) — Linting code and styles |
0 commit comments