Import only auth and firestore from firebase

前端 未结 1 1610
甜味超标
甜味超标 2021-02-12 19:03

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:45

    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)
提交回复
热议问题