{"id":17093997,"url":"https://github.com/elelad/ionicons-cleaner","last_synced_at":"2026-04-19T14:07:57.511Z","repository":{"id":57276129,"uuid":"408930832","full_name":"elelad/ionicons-cleaner","owner":"elelad","description":"Remove unused Ionicons from the Angular build bundle.","archived":false,"fork":false,"pushed_at":"2021-10-08T18:07:23.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T03:27:18.085Z","etag":null,"topics":["angular","ionic","ionic5","ionicons"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elelad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-21T18:25:40.000Z","updated_at":"2021-10-08T18:07:26.000Z","dependencies_parsed_at":"2022-09-15T19:12:50.908Z","dependency_job_id":null,"html_url":"https://github.com/elelad/ionicons-cleaner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elelad/ionicons-cleaner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elelad%2Fionicons-cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elelad%2Fionicons-cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elelad%2Fionicons-cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elelad%2Fionicons-cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elelad","download_url":"https://codeload.github.com/elelad/ionicons-cleaner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elelad%2Fionicons-cleaner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32009243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","ionic","ionic5","ionicons"],"created_at":"2024-10-14T14:09:55.905Z","updated_at":"2026-04-19T14:07:57.467Z","avatar_url":"https://github.com/elelad.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ionicons Cleaner\n\nRemove unused Ionicons from your Angular output.\n\nWhen using ionicons with Angular you have 2 issues:\n- On every build you get all the icons in the output folder. This is affecting the bundle size.\n- If you want to use Angular PWA and prefetch the icons you get the list of all icons even if you only using few of them.\n\nThis repo uses npx to remove all unused icons from the output folder and from the ngsw.json file.\n\n\n\u003e **_NOTE:_**  This package is still under beta testing - use it carefully.\n\n\n## Installation\nRun `npm install -g ionicons-cleaner`\n\n## How to use\n- Run `npx ionicons-cleaner` to remove all unused icons from the output folder.\n- Run `npx ionicons-cleaner --clean-ngsw` to remove all unused icons from the output folder and from ngsw.json.\n\n## Dynamic icons\nIf you set icons dynamically, for example getting them from the server, you need then to be in your build but we don't have a way to know about them during the build.\nIf you have any of those you may get a warning while trying to use this package. Now you have 2 options:\n1. If you sure the warming is false and you don't have icons that sets dynamically in your code you can use the force-delete option: \n`npx ionicons-cleaner --force-delete`\n2. To overcome this you can use the whitelist option to list an icons that won't be deleted even if they didn't found in the code.\nFor example: `npx ionicons-cleaner --whitelist= add close moon --force-delete`\n\n## Options\n\n| Option| Description |\n|:---|:---|\n| `--output-path`     | By default the output path (destination of the build files) is `www`. If you want to run the script on a different folder you can pass the path to this option. |\n| `--svg-dir`     | By default the svg folder is inside the output folder and called `svg`. If you store your svg files in a different folder you can change the name using this option. |\n| `--force-delete`     | Delete icons even if you get the dynamic warning. Use this if you provide whitelist or if you sure the dynamic warning is false and you don't have icons that sets dynamically in your code.  |\n| `--whitelist`     | List of icons that won't be deleted even if they not found in the code. |\n| `--clean-ngsw`     | If you are using Angular service worker set this to true to delete the unused icons from ngsw.json |\n| `--sw-svg`     | The name of the svg asset group in the ngsw.json file. Default is `svg`. |\n| `--dry-run`     | Use this to see how much icons we can delete without actually deleting them. |\n\n## Tested on:\n- Angular 12\n- Ionicons 5","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felelad%2Fionicons-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felelad%2Fionicons-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felelad%2Fionicons-cleaner/lists"}