Skip to content

Commit

Permalink
fix: fixed import error in terminateDatabasesInGenerateHooks
Browse files Browse the repository at this point in the history
  • Loading branch information
lupas committed Nov 30, 2021
1 parent 93ca96b commit 326af38
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,10 @@ function validateConfigKeys(options, currentEnv) {
* See https://github.com/nuxt-community/firebase-module/issues/93
*/
function terminateDatabasesInGenerateHooks(ctx) {
const firebaseDir = ctx.nuxt.options.srcDir + '/node_modules/firebase/'
ctx.nuxt.hook('generate:before', async (generator) => {
const { default: firebase } = await import(firebaseDir + 'app')
const { default: firebase } = await import('firebase/compat/app')
await import('firebase/compat/database')
await import('firebase/compat/firestore')

if (!firebase.apps.length) {
firebase.initializeApp(generator.options.firebase.config)
Expand Down

0 comments on commit 326af38

Please sign in to comment.