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

📅  最后修改于: 2022-03-11 14:48:37.511000             🧑  作者: 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);