This SO thread highlights how you should import distinct firebase functionality into your web app.
In my VueJS SPA, I want to only include firebase/auth into my web app. According to the thread, the following snippet is all that is required.
import * as firebase from 'firebase/app';
import 'firebase/auth';
Unfortunately, the answers/comments in that thread do not specify where exactly this import needs to go and don't explain any part of the snippet either.
I tried adding the above code in my main.js file (the entry point of my app and also where I initialise firebase); however, the entirety of firebase is still bundled into my app after altering my import statements accordingly (as shown below).
My question is, where else do I need to include the above snippet in my web app? Do I need to include both import lines every time I import firebase into a Vue component that uses firebase functions?
Additionally, I feel like my question stems from a lack of understanding of what's actually happening with the imports. Why do we have to import * as firebase and then import 'firebase/auth'?
This Medium post also demonstrates importing specific firebase packages and references 'tree-shaking' but doesn't explain much further. Reading the docs on 'tree-shaking' helped me understand the concept but not how it works in relation to the firebase example.
Note, I'm currently using Webpack v3.6.0 as my bundler.
