You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to achieve dynamic imports with the goal of reducing bundle size, since the project itself is quite heavy when fully bundled. But i ended up having problemns to figure out what should be the correct approach to avoid a full bundle request.
My approach was to create a functional component that was going to received the icon name as a target and try to "lazy" import.
As follows:
I was trying to achieve dynamic imports with the goal of reducing bundle size, since the project itself is quite heavy when fully bundled. But i ended up having problemns to figure out what should be the correct approach to avoid a full bundle request.
My approach was to create a functional component that was going to received the icon name as a target and try to "lazy" import.
As follows:
But i get an error on Vite end:
And an error on the browsers end:
By looking at the folder structure at
@ant-design/icons
this approach looks like it should work:Also the error on the browser is from an icon that i didnt try to use.
Any ideas on what could be done? My goal is to reduce bundle size since i use a great number of icons, but not all of them.
Thanks!
The text was updated successfully, but these errors were encountered: