Import only auth and firestore from firebase

前端 未结 1 903
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-12 18:43

I am attempting to reduce the firebase library size in my vuejs app. I currently import firebase as

import * as firebase from \'firebase\';
require(\"firebase/fi         


        
相关标签:
1条回答
  • 2021-02-12 19:26

    First you need to import the core

    import * as firebase from 'firebase/app';
    

    then import required modules

    import 'firebase/auth';
    import 'firebase/firestore';
    

    or

    var firebase = require("firebase/app");
    require("firebase/auth");
    require("firebase/database");
    
    0 讨论(0)
提交回复
热议问题