mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-14 05:06:16 -08:00
app.config.ts provided MAT_FORM_FIELD_DEFAULT_OPTIONS at the root, and that one import put the whole 54 KB chunk of @angular/material/form-field into the initial bundle, although every form field renders in a lazy route or a dialog. The bundler places a module in one chunk, so one eager import of any export carries the module's entire code. The defaults now travel with the element: AppFormFieldModule (@iptvnator/ui/components/form-field) exports MatFormFieldModule together with a directive that matches mat-form-field and provides the options in its element injector. That also reaches the dialogs that root services open, which a route-level provider would miss. Every component that renders a form field imports it, and tools/nx/check-form-field-defaults.mjs (CI) rejects one that does not. renderer.initialBytes: 1,596,201 -> 1,534,606 bytes (-61,595) on a local production build. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>