AOT / Build — CLI Reference

ng-image-optimizer-aot scans your browser dist, generates resized variants with Sharp, and writes them next to the originals using the naming convention.

bash
ng-image-optimizer-aot --help

Options

FlagDescriptionDefault
--distPath to Angular browser output (required)
--pathsComma-separated globs relative to --dist**
--skipGlobs to exclude (e.g. icons/**)
--qualityOutput quality 1–10090
--formatwebp | avif | jpegwebp
--widthsComma-separated pixel widths to generate640,828,1080,1200,1920
--concurrencyParallel Sharp workers4
--blurGenerate a small blurred placeholder (64px)off

Examples

bash
ng-image-optimizer-aot --dist ./dist/my-app/browser --format webp
bash
ng-image-optimizer-aot \
  --dist ./dist/app/browser \
  --paths "assets/**,images/**" \
  --skip "icons/**" \
  --quality 80 \
  --format avif \
  --widths 640,750,1080,1920