-
Notifications
You must be signed in to change notification settings - Fork 929
How to only load the Firebase dependencies I need? #715
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
Comments
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information. |
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight. |
Seems like if I do |
Oh no, never mind. That breaks calls like |
@corysimmons you are not alone. I have tried using the scoped packages but while it may build, almost everything breaks. It's fine, this is a packaged mobile app for me so the extra few compressed KB are ok but I know for web apps it's a big deal.. |
So we do have a solution here, it's not as optimal as it could be, but it is better than using those things you are not! Note: See https://medium.com/@jshcrowthe/lazy-loading-with-firebase-4-1-x-c51f67a51f56 for a blog post highlighting some of these points, the same principles apply to module builds and are explained below The following will get you a import firebase from 'firebase/app';
import 'fireabse/database';
import 'firebase/auth';
// Do firebase things...
firebase.initializeApp({...}) If you attempt to reference As @codinronan mentioned the scoped packages are not recommended for direct usage (though we use them to build the
We are actively working on the story here and will keep you posted. |
Half my app is Firebase.
firebaseui
,database
,app
, andauth
are fine, but I'm not even usingstorage
,messaging
,util
, orlogger
.I have to
import * as firebase from 'firebase'
so I can do things likefirebase.initializeApp(config)
andfirebase.auth.GoogleAuthProvider.PROVIDER_ID
.Is there some way I can get rid of those unused packages and shave 100kb off my PWA? :\
Update:
I tried https://www.npmjs.com/package/@firebase/app as well to no avail.
The text was updated successfully, but these errors were encountered: