Replies: 1 comment 4 replies
-
Interesting, when using vite my bundle size is larger than the same app with webpack. I would be surprised if vite does not tree shake by default but maybe a config file is necessary.
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Adding this to my project more than doubles my javascript size. I'd like to lazy-load if it it's going to be this big, but it feels like something else is going wrong maybe.
Looking at this https://firebase.blog/posts/2021/08/the-new-firebase-js-sdk-now-ga specifically the "a small firebase" image shows that the app should be 5.21kb and the messaging 12k - waaaay off from what I'm seeing.
I'm using vite with rollup. I believe it's tree-shaking, but it's hard to tell.
Looking at the visualizer i'm using sounds like the reported sizes aren't exactly accurate (my overall js file size actually increases only 240kb -> 320kb), but it still seems far larger than expected (80kb vs 17kb). btd/rollup-plugin-visualizer#96
Any help welcome :) I'll look into dynamic module imports to only load when I want to prompt the user for web push notification permission, but that ends up download even more (the full library since it can't be tree-shaken).
Beta Was this translation helpful? Give feedback.
All reactions