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

Customize output filename #164

Open
treksn opened this issue Apr 8, 2022 · 2 comments
Open

Customize output filename #164

treksn opened this issue Apr 8, 2022 · 2 comments

Comments

@treksn
Copy link

treksn commented Apr 8, 2022

We are using svg-to-ts in our project to inline SVGs which works really nice. However these SVGs are not really "icons" and I wonder if it would be possible to customize the filename of the generated output files from your library. Currently it is like this: file-name.icon.ts . Would it be possible to customize this withing the config for example file-name.svg.ts ? That would be nice.

Thank you!

@nivekcode
Copy link
Owner

Hi @treksn thx a lot for this issue. Yes, that's definitely possible. I can take a look at this once I find the time. Unfortunately, I can currently not think of a descriptive name for this option. Naming, the hardest thing in programming. Good ideas for on how to name this options are more then welcome ;)

@rubens-lopes
Copy link

Hi everyone,

We have a similar need, maybe a bit more complex.

In our case our svg lib outputs the following for each icon:
image
It is exported that way because of mobile apps. On the web we intent to use only the 24 size, so we want to drop the _24 and the _filled parts of the name and change the regular to _outline. For now we have another script between the svg lib output and the svg-to-ts that copy and transform all file names to a second directory.

ex:

add_subtract_circle_24_regular.svg -> add_subtract_circle_outline.icon.ts
add_subtract_circle_24_filled.svg  -> add_subtract_circle.icon.ts

Name suggestion: filename-replacer: [ { '_24': '' }, { '_regular': '_outline' }, { '_filled': '' }, ]

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

No branches or pull requests

3 participants