Open Evaldas-B opened 3 months ago
Noticed the same thing when importing @tabler/icons-react as well. That library should be completely tree shakeable.
Noticed the same thing when importing @tabler/icons-react as well. That library should be completely tree shakeable.
It doesn't only happen with @tabler/icons-react, but since this library has a lot of components it effect build times drastically so its very noticeable. Same behavior with other libraries too.
Were you able to find a workaround? I don't even mind the slow build for dev but if there is something I could hardcode to get it to minimize the production build that would be nice.
Were you able to find a workaround? I don't even mind the slow build for dev but if there is something I could hardcode to get it to minimize the production build that would be nice.
No, not really, what I've done is I've created a folder containing the Icons that I am using by manually copying and pasting them and importing icons from there, instead of installing the library. Works for now, but it's not going to be manageable for anything else than icons.
What happened?
Installing and importing external libraries unreasonably increases build times and bundle size. Tree shaking is not taking effect.
Environment: WSL2 Plasmo version: 0.87.1 Node: v20.12.2
Steps to reproduce:
pnpm create plasmo
pnpm build
for reference point. Build time is 1379ms✔ build size is 153kb✔pnpm install @tabler/icons-react
rm -rf .plasmo build
popup.tsx
file:export default function IndexPopup() { return
}
So final bundle includes additional 21264 lines of code❗
Related to issue #664
Version
Latest
What OS are you seeing the problem on?
Linux, Other
What browsers are you seeing the problem on?
Microsoft Edge
Relevant log output
(OPTIONAL) Contribution
Code of Conduct