-
Notifications
You must be signed in to change notification settings - Fork 55
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
Feature: Allow dynamic import of icon for easier bundling #2025
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the premise of this. Can I ask what the need is to change all icons to .ts files?
@iOvergaard The only reason was that I started to get type errors with js files. I don't know how we could avoid that before. 🤔 |
I think it worked because it was just a variable, and we additionally had Vite ignore it on the dev server with:
|
Description
Currently, we import icons based on a relative path. This causes some trouble when bundling the icon-registry module as files might not be located in the same place after bundling. This PR adds the extra option to "manually" import the icon file (the same way we do in manifests) like
path: () => import('./path/to/icon.js').
This way the bundler knows where the files are located and will handle them correctly.What to test
Types of changes