FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(vite): add HMR support for local SVG by userquin · Pull Request #425 · unplugin/unplugin-icons · GitHub

feat(vite): add HMR support for local SVG - #425

Open
userquin wants to merge 1 commit into
mainfrom
userquin/feat-add-hmr-support
Open

feat(vite): add HMR support for local SVG#425
userquin wants to merge 1 commit into
mainfrom
userquin/feat-add-hmr-support

Conversation

userquin commented Nov 2, 2025

Copy link
Copy Markdown
Member

Description

This PR adds HMR support for Vite (only) for local SVG files, added a new hmrResolver option to resolve local icon collection/name from the file.

Linked Issues

resolves #424

Additional context

/cc @antfu maybe we can also add support for webpack and some others bundlers but I'm lazy to check them (sorry 🙏)

Copy link
Copy Markdown

Run & review this pull request in StackBlitz Codeflow.

pkg-pr-new Bot commented Nov 2, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/unplugin-icons@425

commit: 3aec879

antfu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I am not sure about this solution, as this would require users to write their own resolvers, which would cost too much work and introduce a lot of false negatives. And I would not expect majority of our users aware of this config and know how to write the resolver.

I would wish something more smart/automatic.

Maybe we should host the fs loading, to introduce a new option to set the relationship between files and icon conventions, where we augment FileSystemIconLoader internally, while still having the information for HMR.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

Custom icons HMR failure

2 participants


Back | FazBrowse Home | New Git URL