firebaseを使っているのですがコンソールに以下のWarningが出ます。
It looks like you're using the development build of the Firebase JS SDK. When deploying Firebase apps to production, it is advisable to only import the individual SDK components you intend to use. For the module builds, these are available in the following manner (replace <PACKAGE> with the name of a component - i.e. auth, database, etc): CommonJS Modules: const firebase = require('firebase/app'); require('firebase/<PACKAGE>'); ES Modules: import firebase from 'firebase/app'; import 'firebase/<PACKAGE>'; Typescript: import * as firebase from 'firebase/app'; import 'firebase/<PACKAGE>';
JavaScriptファイルは以下のようになっております。
どうやったらこの警告は消えますでしょうか??
import Vue from 'vue' import firebase from 'firebase/app' import 'firebase/app' import 'firebase/firestore' import 'firebase/auth' import App from './App.vue' import router from './router' import store from './store' // Initialize Firebase var config = { apiKey: "〇〇〇〇〇〇〇〇〇〇〇〇", authDomain: "〇〇〇〇〇.firebaseapp.com", databaseURL: "https://〇〇〇〇〇.firebaseio.com", projectId: "〇〇〇〇〇〇〇〇〇〇〇〇", storageBucket: "〇〇〇〇〇〇〇〇〇〇〇〇", messagingSenderId: "〇〇〇〇〇〇〇〇〇〇〇〇", appId: "〇〇〇〇〇〇〇〇〇〇〇〇" }; firebase.initializeApp(config); let app; firebase.auth().onAuthStateChanged(() => { if(!app){ app =new Vue({ router, store, render: h => h(App), }).$mount('#app') } }) const db = firebase.firestore(); export default db;
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/19 23:30
2019/05/20 04:30
2019/05/23 16:17