import Vue from 'vue'
import Firebase from 'firebase'

const firebasePlugin = {
  install () {
    if (Vue.__nuxt_firebase_installed__) {
      return
    }
    Vue.__nuxt_firebase_installed__ = true

    if (!Vue.prototype.$firebase) {
      Vue.prototype.$firebase = Firebase.initializeApp({
        apiKey: process.env.apiKey || '<%= options.apiKey %>',
        authDomain: process.env.authDomain || '<%= options.authDomain %>',
        databaseURL: process.env.databaseURL || '<%= options.databaseURL %>',
        storageBucket: process.env.storageBucket || '<%= options.storageBucket %>'
      })
    }
  }

}

Vue.use(firebasePlugin)

export default (ctx) => {
  const { app, store } = ctx

  app.$firebase = Vue.prototype.$firebase
  ctx.$firebase = Vue.prototype.$firebase
  if (store) {
    store.$firebase = Vue.prototype.$firebase
  }
}

@@ -46,16 +46,44 @@
 irebase'
+%0Aimport 'firebase/firestore'
 %0A%0Aconst 
@@ -527,24 +527,97 @@
 aseURL %25%3E',%0A
+        projectId: process.env.projectId %7C%7C '%3C%25= options.projeectId %25%3E',%0A
         stor

support firestore (#172)