8000 Why don’t you declare the icons as ES Modules, so they’re fully tree-shakable? · Issue #51 · oktaysenkan/monicon · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

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 8000 terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fivaz3 opened this issue Nov 17, 2024 · 6 comments · May be fixed by #70
Open

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

fivaz3 opened this issue Nov 17, 2024 · 6 comments · May be fixed by #70
Labels
enhancement New feature or request

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
@oktaysenkan
Copy link
Owner

I just created the issue on metro repo

facebook/metro#1422

@oktaysenkan oktaysenkan added the enhancement New feature or request label Dec 30, 2024
@oktaysenkan
Copy link
Owner
oktaysenkan commented Feb 5, 2025

I will build a CLI tool to automate the generation of icon files in different formats (.tsx, .jsx, .vue, .svg, etc.). This enables fully tree shakable icons.

Core Features:

  • Users can set a custom output path (default: src/components/icon).
  • Supports predefined templates for different frameworks (SVG, React JSX, React TSX, Vue, etc.).
  • Allows users to define custom templates, similar to a custom loader, making it possible to use Monicon in other programming languages.

This will streamline icon management and improve workflow efficiency. What do you think?

@oktaysenkan oktaysenkan linked a pull request Mar 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0