I am using the newest Firebase version 9 and I was trying to optimize loading times. One way could be to dynamically load the firebase modules only when they are needed instead of waiting for all of them to be loaded. For example importing the signOut() function from 'firebase/auth' only when the user clicks the sign out button. Would this strategy work? I am strugling to implement it on firebase 9. Are there any examples available?
So far I have tried:
index.js: the below code didn't work, aparently webpack could't compile (error: The top-level-await experiment is not enabled)
let {signOut, signInAnonymously, etc.} = await import('firebase/auth');