Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BruneXX opened this issue Jul 5, 2024 · 4 comments

Comments

@BruneXX
Copy link

BruneXX commented Jul 5, 2024

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!

@BruneXX
Copy link
Author

BruneXX commented 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.

@moamenhredeen
Copy link

is there any plans to add this feature

@NotTsunami
Copy link
Collaborator

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.

@khalilou88
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants