[GH-ISSUE #704] Only need the flags I want in my project #368

Closed
opened 2026-03-03 14:37:52 +03:00 by kerem · 3 comments
Owner

Originally created by @daniaaalarshad on GitHub (Apr 14, 2020).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/704

Is there a possibility to only include the flags which I need through npm and not all the country flags, I want to save the storage.
Or maybe its a good idea just to download from the resource from lipis you provided ? what do you say ?

Originally created by @daniaaalarshad on GitHub (Apr 14, 2020). Original GitHub issue: https://github.com/lipis/flag-icons/issues/704 Is there a possibility to only include the flags which I need through npm and not all the country flags, I want to save the storage. Or maybe its a good idea just to download from the resource from lipis you provided ? what do you say ?
kerem closed this issue 2026-03-03 14:37:52 +03:00
Author
Owner

@CapitaineToinon commented on GitHub (May 11, 2020):

You could use PurgeCSS to get rid of unused flags in your build step.

<!-- gh-comment-id:626730908 --> @CapitaineToinon commented on GitHub (May 11, 2020): You could use [PurgeCSS](https://purgecss.com/) to get rid of unused flags in your build step.
Author
Owner

@daniaaalarshad commented on GitHub (May 12, 2020):

@CapitaineToinon ahan nice :D, Thankyou (Y)

<!-- gh-comment-id:627616612 --> @daniaaalarshad commented on GitHub (May 12, 2020): @CapitaineToinon ahan nice :D, Thankyou (Y)
Author
Owner

@TheSlimvReal commented on GitHub (Oct 4, 2021):

Picking up on this question. How exactly would I do that? As far as I understand it, I have to run PurgeCSS on the flag-icon.min.css but this I have to do before building the application so the svg are not created.

As a background, I am using a service worker to cache all the flag icons so I need to remove all the unused flag icons before deployment.

<!-- gh-comment-id:933400622 --> @TheSlimvReal commented on GitHub (Oct 4, 2021): Picking up on this question. How exactly would I do that? As far as I understand it, I have to run PurgeCSS on the `flag-icon.min.css` but this I have to do **before** building the application so the `svg` are not created. As a background, I am using a service worker to cache all the flag icons so I need to remove all the unused flag icons before deployment.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flag-icons#368
No description provided.