-
Notifications
You must be signed in to change notification settings - Fork 407
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
@firebase/database included in the final build while I only use firestore #489
Comments
Hi @MaciejCaputa, I think this might be related to an issue I'm investigating #488 (comment). Just curious, what build tool are you using, and can you please confirm that you have tree-shaking enabled in your build? |
Hi @jhuleatt I am still running into this issue using the following. Webpack is properly tree-shaking other libraries but Dependencies The only firebase imports we are using are This is our treemap of the firebase bundle from Lighthouse: |
Hey there, got the same issue, I just pulled all my hairs out my head to know what libraries was causing this. finally I just did a little hack with the webpack config by using https://webpack.js.org/configuration/externals/
this hack force remove the firebase/database dependency out of the bundle. |
Thanks all for the additional information. We've just published ReactFire Lines 13 to 34 in f6d2351
@alexduhem or others - can you please give version |
Hi @jhuleatt, Thanks for the update. I upgraded from Dependencies Before
After
|
@robertn702 thanks for trying it out! That's a big surprise to me. According to bundlephobia, the bundle is smaller than I'll look into this a bit more. Thanks again! |
Hi @jhuleatt, I am unsure if the issue is on Next.js or Reactifire's end, but when using both, everything from Firebase is pulled in the final bundle just by importing the main app provider in I have provided a repository to reproduce this issue:
When finished, the browser will open the output below: Any help would be super appreciated! |
I am facing the same issue as @Gbuomprisco |
@Laityned if it can help, I worked it around by extending the webpack config in the next.js config file like below:
|
Thank you for the work around. I will definitely use it. I could help with a PR, if anyone has a clue why it is not tree shaking out firebase. |
The library is basically unmaintained, which is sad. |
In my app I only provide firestore and I don't use a real-time database but I see it increasing my bundle size. Any advice? (I don't have it imported anywhere).
The text was updated successfully, but these errors were encountered: