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

364K (uncompressed) of mostly unused icons? #154

Open
sdhull opened this issue Mar 21, 2020 · 5 comments
Open

364K (uncompressed) of mostly unused icons? #154

sdhull opened this issue Mar 21, 2020 · 5 comments
Labels

Comments

@sdhull
Copy link

sdhull commented Mar 21, 2020

Is the "inline" strategy really supposed to include every single icon in vendor.js?

Describe your question

I was under the impression that at build-time, {{svg-jar "plus-icon"}} would be replaced by <svg..>...</svg>. Is this not the case? Should I not be adding icons to my project until they're being used?

image
image

Search tags, topics

package size, compiled size

@voltidev
Copy link
Collaborator

It will include all .svg files that it can find in sourceDirs (public dir by default ).
So I would suggest to add only the icons you need.

I have a plan to make it possible to tell SVGJar what icons you need, so you can add all your icon sets to the SVGJar viewer without adding them to the vendor.js file.

@sdhull
Copy link
Author

sdhull commented Mar 21, 2020

Yeah that would be really cool. Like a config option onlyInclude: ['add.svg', /somepath\/.*svg/] and if that is empty or undefined then it includes everything by default? Or would you scan for usages of {{svg-jar and only include icons referenced automagically?

After looking through the options again, it looks like I could at least keep all my icons in my repo and then specify sourceDir and only copy or move icons over as needed so not toooo bad but I wish I could have them all in the viewer but only include icons in the build that are referenced (or failing that, whitelist them as needed for inclusion in the build).

@wilkosz
Copy link

wilkosz commented Oct 13, 2020

It will include all .svg files that it can find in sourceDirs (public dir by default ).
So I would suggest to add only the icons you need.

I have a plan to make it possible to tell SVGJar what icons you need, so you can add all your icon sets to the SVGJar viewer without adding them to the vendor.js file.

Has there been any progress with this?

@xud6
Copy link

xud6 commented Dec 2, 2020

Just hit this today.

I think every svg files is included in the final build really is an unexpected behavior nowadays, probably should say something about it in the readme

@betocantu93
Copy link
Contributor

betocantu93 commented Mar 24, 2021

I think this could be solved with the new hbs strategy #186 , they are converted to template-only components at build time and downloaded when invoked in runtime, so there's 0 kbs added to vendor, they pretty much kinda work like a normal image tag... with the benefits of splattributes and modifiers!

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

No branches or pull requests

5 participants