[GH-ISSUE #1276] Possible new feature - A way to generate assets (flags svg's) in a specific folder during angular compilation #587

Closed
opened 2026-03-03 14:39:33 +03:00 by kerem · 5 comments
Owner

Originally created by @BruneXX on GitHub (Jul 5, 2024).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/1276

I'm reporting this related to the issue: https://github.com/lipis/flag-icons/issues/1265 starting from comment: https://github.com/lipis/flag-icons/issues/1265#issuecomment-2209366895

I'm using this library with Angular and I want to avoid (at compilation time) that angular build generates all the svg files in the root folder, do you know if there's any way to move all those *.svg files to a folder? in order to be used like:

/flags/*.svg files

My idea is to have this structure:
./project/assets/flags/*.svg
./project/project_file1.js
./project/project_file2.js
./project/project_fileN.js

it will be possible to add a way to set an absolute path for the flags svg files instead as an alternative to those relative paths? maybe a new lib feature to achieve that?

I think that will probably solve the problem that I've with the angular build setting all the flag images in the root folder of the build...

I'll appreciate to hear from you an this, thanks!

Originally created by @BruneXX on GitHub (Jul 5, 2024). Original GitHub issue: https://github.com/lipis/flag-icons/issues/1276 I'm reporting this related to the issue: https://github.com/lipis/flag-icons/issues/1265 starting from comment: https://github.com/lipis/flag-icons/issues/1265#issuecomment-2209366895 I'm using this library with Angular and I want to avoid (at compilation time) that angular build generates all the **svg** files in the root folder, do you know if there's any way to move all those *.**svg** files to a folder? in order to be used like: /flags/*.svg files My idea is to have this structure: ./project/assets/flags/*.svg ./project/project_file1.js ./project/project_file2.js ./project/project_fileN.js it will be possible to add a way to set an absolute path for the flags **svg** files instead as an alternative to those relative paths? maybe a new lib feature to achieve that? I think that will probably solve the problem that I've with the angular build setting all the flag images in the root folder of the build... I'll appreciate to hear from you an this, thanks!
kerem 2026-03-03 14:39:33 +03:00
Author
Owner

@BruneXX commented on GitHub (Jul 5, 2024):

Another thing that it will be really great is if we could add just the flags needed instead of all the flags, but that's less important for me than the other feature.

<!-- gh-comment-id:2210998906 --> @BruneXX commented on GitHub (Jul 5, 2024): Another thing that it will be really great is if we could add just the flags needed instead of all the flags, but that's less important for me than the other feature.
Author
Owner

@moamenhredeen commented on GitHub (Jul 21, 2024):

is there any plans to add this feature

<!-- gh-comment-id:2241585292 --> @moamenhredeen commented on GitHub (Jul 21, 2024): is there any plans to add this feature
Author
Owner

@NotTsunami commented on GitHub (Oct 3, 2024):

Another thing that it will be really great is if we could add just the flags needed instead of all the flags, but that's less important for me than the other feature.

This is something I've been specifically looking into recently. You should be able to use PurgeCSS for this. I don't know if you can integrate PurgeCSS directly into your build process using the PostCSS plugin with Angular 18 and esbuild, but you can definitely do a postbuild step invoking PurgeCSS.

I'm reporting this related to the issue: #1265 starting from comment: #1265 (comment)

I'm using this library with Angular and I want to avoid (at compilation time) that angular build generates all the svg files in the root folder, do you know if there's any way to move all those *.svg files to a folder? in order to be used like:

/flags/*.svg files

My idea is to have this structure: ./project/assets/flags/*.svg ./project/project_file1.js ./project/project_file2.js ./project/project_fileN.js

it will be possible to add a way to set an absolute path for the flags svg files instead as an alternative to those relative paths? maybe a new lib feature to achieve that?

I think that will probably solve the problem that I've with the angular build setting all the flag images in the root folder of the build...

I'll appreciate to hear from you an this, thanks!

This I will do some due diligence on. I've only used React and Vue in the field, so I don't have experience with configuring Angular builds. It's been proposed that we change our folder structure, and I'm not entirely opposed to this, but I don't think that would directly affect the output structure.

<!-- gh-comment-id:2392033742 --> @NotTsunami commented on GitHub (Oct 3, 2024): > Another thing that it will be really great is if we could add just the flags needed instead of all the flags, but that's less important for me than the other feature. This is something I've been specifically looking into recently. You should be able to use PurgeCSS for this. I don't know if you can integrate PurgeCSS directly into your build process using the PostCSS plugin with Angular 18 and esbuild, but you can definitely do a postbuild step invoking PurgeCSS. > I'm reporting this related to the issue: #1265 starting from comment: [#1265 (comment)](https://github.com/lipis/flag-icons/issues/1265#issuecomment-2209366895) > > I'm using this library with Angular and I want to avoid (at compilation time) that angular build generates all the **svg** files in the root folder, do you know if there's any way to move all those *.**svg** files to a folder? in order to be used like: > > /flags/*.svg files > > My idea is to have this structure: ./project/assets/flags/*.svg ./project/project_file1.js ./project/project_file2.js ./project/project_fileN.js > > it will be possible to add a way to set an absolute path for the flags **svg** files instead as an alternative to those relative paths? maybe a new lib feature to achieve that? > > I think that will probably solve the problem that I've with the angular build setting all the flag images in the root folder of the build... > > I'll appreciate to hear from you an this, thanks! This I will do some due diligence on. I've only used React and Vue in the field, so I don't have experience with configuring Angular builds. It's been proposed that we change our folder structure, and I'm not entirely opposed to this, but I don't think that would directly affect the output structure.
Author
Owner

@klagrida commented on GitHub (Nov 28, 2024):

@BruneXX Why about just inline the svg flag in your code ?
This is my approach with angular with standalone components.

<!-- gh-comment-id:2506009071 --> @klagrida commented on GitHub (Nov 28, 2024): @BruneXX Why about just inline the svg flag in your code ? This is my approach with angular with standalone components.
Author
Owner

@lipis commented on GitHub (Jan 16, 2025):

Not sure if this should be part of this project.. Sorry!

<!-- gh-comment-id:2596917652 --> @lipis commented on GitHub (Jan 16, 2025): Not sure if this should be part of this project.. Sorry!
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#587
No description provided.