📜  Firebase:名为“[DEFAULT]”的 Firebase 应用已存在(应用重复应用). - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:20.596000             🧑  作者: Mango

代码示例5
// Config file
import * as firebase from "firebase";

const config = {...};

export default !firebase.apps.length ? firebase.initializeApp(config) : firebase.app();

// Other file
import firebase from '../firebase';
...
console.log(firebase.name);