-
Notifications
You must be signed in to change notification settings - Fork 14
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
?url
export option bypasses svgo
#124
Comments
looking at the source it does not support optimizing the but since we are handling the import before that, we can probably simply url encode it ourselves and not rely on vite's functionality, this should be easy I guess. I'll work on it when I have time, not sure if I can do this week |
Thanks for considering adding this feature :-) Maybe keep the current behavior as default and add a config option that allows to run url imports through svgo optimization? This would avoid the breaking change ... |
hmm, good idea, thanks! |
I was really tired and I see that I misunderstood the feature lol I have to rethink how to do it, and how feasible it is |
I guess I would be happy with the url encoded version as well, if it can be used as a favicon ... |
sorry, I didn't have access to my laptop for around 1.5 weeks url encoded version probably can be done quite easily, but not sure about how the direct url to optimized file works, so will put that for a later time |
I have released the |
@frederikheld did you manage to test it ? |
I've seen that you implemented it, thanks a lot, that's awesome. However I did not find the time to test it as I have to take care of a different project atm. As soon as i get back to this project, I'll let you know if something doesn't work as expected :-) Thanks again for providing a solution so quickly! |
The
nuxt-svgo
docs don't mention this feature, but thevite-svg-loader
docs do: it is possible to import a svg as a file url (instead of embedding it into the source of the page) and it works withnuxt-svgo
as well. I use this feature to generate an optimized version of the svg to use it as favicon.Unfortunately this option seems to bypass the optimization through
svgo
. The default import embeds an optimized version of the svg into the source code, but the url import generates a file that is exactly the same as the asset that went in. Is this on purpose? Is there any way to have the optimization with the url import? Unfortunately thevite-svg-loader
docs only mention that it is possible, but neither how it works inside nor how it can be configured...I fiddled around with the
svgoConfig
option ofnuxt-svgo
but couldn't find any working configuration. Any ideas?The text was updated successfully, but these errors were encountered: