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

Why don’t you declare the icons as ES Modules, so they’re fully tree-shakable? #51

Open
fivaz3 opened this issue Nov 17, 2024 · 4 comments

Comments

@fivaz3
Copy link

fivaz3 commented Nov 17, 2024

You wouldn’t have to deal with the hassle of manually adding the icons you’re going to use in the vite.config.js.

Even if your library has millions of icons, all of them would be available during development, but only the ones actually used would be included in the final build shipped to the client.

@oktaysenkan
Copy link
Owner

I don’t like multiple imports for icons but i can add this feature later.

Example usage

import UserIcon from "@monicon/lucide/user"
import AccountIcon from "@monicon/lucide/account"

@fivaz3
Copy link
Author

fivaz3 commented Nov 19, 2024

thanks, it would be great

@fivaz3 fivaz3 closed this as completed Nov 19, 2024
@benweier
Copy link

@oktaysenkan This would be far more preferable than adding individual icon names to the build config or unnecessarily bloating the bundle with an entire collection. I'd love to recommend we adopt Monicon within my workplace, as the standard icon solution for all our apps, but unfortunately I can't do that if the DX every time is "use an icon.. check the config"

@oktaysenkan
Copy link
Owner

I am thinking a solution for this. Metro does not provide module load function like Vite.

@oktaysenkan oktaysenkan reopened this Nov 25, 2024
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