Open justingolden21 opened 2 years ago
Hey @justingolden21, thanks for your feedback. It's not possible to generate only one icon at the moment.
That will be most likely possible with the next major version of the library which will provide flexibility for the images you need as an output.
Can you please share more details about your use case of using multiple inputs? That can also be considered in the redesign.
Thanks for the reply and for considering that for future releases : )
I have a manifest and shortcuts for each item which contain icons. Those icons are currently SVGs and I like how pwa-asset-manager handles rendering svg icons dynamically and I already use it in my project, so I figured I would use it for this (fairly similar) purpose.
A few ideas for potential ways to input multiple files:
a file path and it checks for all images or images of a specific type in that folder (Could also match a regex)
a list of file paths (can be a lot of many files and long file path, but easiest to implement and understand)
a file path followed by list of file names inside that directory
Is your feature request related to a problem? Please describe. I have multiple icons for pages in my PWA and want to generate one icon each.
Describe the solution you'd like A CLI flag for one single icon. Currently
--icon-only
generates 3 icons. I have to delete each icon that I don't need before pushing.Describe alternatives you've considered Deleting the icons and making a very very long script in
package.json
.Additional context Currently, the command:
pwa-asset-generator static/img/pages/clock.svg static/img/pages/png --icon-only --opaque false
takes inclock.svg
and generates three icons. This is the smallest number I've got after trying nearly every combination of flags. Also, providing simplypwa-asset-generator static/img/pages/
as a path I was hoping it would read each file, or that I could provide a list of files, eg..../clock.svg .../stopwatch.svg
etc.My command currently looks like:
pwa-asset-generator static/img/pages/clock.svg static/img/pages/png --icon-only --opaque false && pwa-asset-generator static/img/pages/worldclock.svg static/img/pages/png --icon-only --opaque false && pwa-asset-generator static/img/pages/stopwatch.svg static/img/pages/png --icon-only --opaque false
and that's just for three pages, can't imagine if I had more. Also, I have to manually select the 6 unnecessary files and delete them. And of course there's a name conflict so it only generates the most recent icons.So currently, for each page, I edit the script command, run it, copy the one file I need, rename the file, change the script command for the other file name, and so on until all icons are done. Very tedious human work.
Thanks in advance 😄