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

All icons load automatically #2

Closed
sureshjoshi opened this issue Feb 24, 2022 · 4 comments
Closed

All icons load automatically #2

sureshjoshi opened this issue Feb 24, 2022 · 4 comments

Comments

@sureshjoshi
Copy link

So, this may be a Svelte thing, a SvelteKit thing, or ... some other thing. But, I'm using this library in a project, and I've imported a couple of icons: import { MenuIcon, UserIcon, XIcon } from "@rgossiaux/svelte-heroicons/solid";

However, on running my application, I see that all heroicons (and headlessui components, incidentally) are loaded at once on page refresh in my dev server.

Screen Shot 2022-02-24 at 11 24 14

I see in my network explorer that these files are imported:
http://localhost:8080/node_modules/@rgossiaux/svelte-headlessui/index.js?t=1645717182624
http://localhost:8080/node_modules/@rgossiaux/svelte-heroicons/solid/index.js?t=1645717182624&v=9b4f8992

and each of those then re-export all components in the projects.

Is that intended?

@rgossiaux
Copy link
Owner

Yeah, I believe this is related to sveltejs/kit#2612 Personally I see this in dev mode but not in production.

Though even turning on the experimental setting mentioned in that issue, I see all the icons being prebundled together into one big file in dev mode. I'm not sure if there's an alternate way of managing the exports that would fix this--it needs some more investigation.

@sureshjoshi
Copy link
Author

sureshjoshi commented Feb 26, 2022

Ah, okay, thanks for pointing me at the SvelteKit issue - I didn't see that one. I'm also only seeing it in dev, and I only noticed it because of one weird use case which required full refreshes

@Obeyed
Copy link

Obeyed commented May 15, 2022

Importing each icon directly doesn't load all icons:
import UserIcon from "@rgossiaux/svelte-heroicons/solid/User"

@sureshjoshi
Copy link
Author

Closing, as this isn't a heroicons problem.

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