hashmd
hashmd copied to clipboard
Only import the necessary functions needed from lodash
Hey there :)
I was looking into slow loading times after adding bytemd. In the network tab, it shows that every lodash function is being imported, which surely isn't necessary? It might not add that much to the loading time (I'm not sure?), but it seems like an easy performance boost.
I believe the problem originates from this line: https://github.com/bytedance/bytemd/blob/178712baa4fad57b834623496341579d69b54815/scripts/postinstall.mjs#L5
Another issue is that every single icon from @icon-park/svg is being imported. Is that also necessary?
In total, there must be hundreds of extra dependencies being imported
Which bundler are you using?
Given Vite as an example, it should bundle all dependencies into a file before starting the dev server.
I am using Vite, yeah. I don't quite understand what that means. Are you saying it's unavoidable if I use Vite?
Are you saying it's unavoidable if I use Vite
Quite the contrary, I guess it should avoid this problem.
Could you please provide a minimal reproduction? So we can look into it