This library is used to uniquely group the ionIcons in a project, and generate for export ionIcons file. In small projects, it is difficult to manage addIcons() of ionIcons each time, so we automated it.
- development: Stress-free development by add all icons at
addIcons. - Production: Automatically collect and update the ionIcon used in the template prior to build.
Of course, to maximize bundle size reduction, it is important to load a minimum number of icons at each Component lazy loading. This is a compromise to speed up development.
This project is based ionic-team/ionic-angular-standalone-codemods .
- Node.js >= 22
- Ionic Angular >= 9.0.0
- Angular >= 18.0.0
- TypeScript >= 5.4.0
- ionicons >= 8.0.0
- @angular-eslint/template-parser 21 or 22
After Installation, initialize addIcons and collect icons before production builds:
npx @rdlabo/ionic-angular-collect-icons --initialize trueDetails: Initialize and Usage.
Commit the consuming application's current changes, then run Ionic's official migration tool from the application root:
npx @ionic/migrateIt applies safe automatic changes and reports items that require manual review. After it finishes, update this package and follow the Ionic Angular 9 migration guide for the remaining checks.
npm install --save-dev \
@rdlabo/ionic-angular-collect-icons \
@angular-eslint/template-parser@^21Use @angular-eslint/template-parser@^22 instead when the consuming project
uses Angular ESLint 22. The parser is a peer dependency so the collector uses
the same Angular template parser major as the consuming project.
Start with Installation, then Initialize and Usage.
- Initialize — wire
addIconsautomatically or by hand. - Usage — run the collector before production builds.
- Migration — migrate an existing project to Ionic Angular 9.
- CLI Options —
--dry-run,--initialize, paths. - FAQ — tests, binding, and
main.ts.
Full documentation: https://docs.rdlabo.dev/projects/ionic-angular-collect-icons
An open, non-draft pull request can be published to the npm beta dist-tag after its CI, Lint, Package Candidate workflows pass. A repository owner or maintainer must add a comment whose entire body is:
/beta
The request authorizes only the pull request head SHA that existed when the comment was added. The workflow revalidates the owner or maintainer permission and head SHA immediately before publishing. Any new commit requires CI to pass again and a fresh owner or maintainer /beta comment. Fork pull requests are supported. Pull requests that change a release-gating workflow cannot be beta-published until those workflow changes land on main.
Beta versions use <base>-beta.pr<PR number>.sha<12-character SHA>. The candidate is built in a read-only workflow without npm publishing credentials. The privileged release workflow publishes only the validated immutable package artifact with lifecycle scripts disabled. A notification failure cannot invalidate a successful npm publish.
When a pull request is merged into main, it is automatically published to beta only after the required CI and Package Candidate succeed for that exact merge commit. Direct pushes to main do not publish a candidate.
Only npm run release creates a release tag. Stable vX.Y.Z tags publish to npm latest; revision/prerelease tags publish to next. Neither beta nor next publishing changes the npm latest dist-tag.
This project is licensed under the MIT License.