Skip to content

Commit 61d3358

Browse files
committed
fix: transpile vuefire
1 parent 5b8ff48 commit 61d3358

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

packages/nuxt/src/module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ const VueFire: NuxtModule<VueFireNuxtModuleOptions> =
9494

9595
// nuxt.options.build.transpile.push(templatesDir)
9696
nuxt.options.build.transpile.push(runtimeDir)
97+
// FIXME: this is a workaround because of the resolve issue with firebase
98+
// without this, we use different firebase packages within vuefire and nuxt-vuefire
99+
nuxt.options.build.transpile.push('vuefire')
100+
nuxt.options.build.transpile.push('vuefire/server')
97101

98102
if (nuxt.options.ssr && options.admin) {
99103
// check the provided config is valid

packages/nuxt/templates/plugin.ejs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,14 @@ export default defineNuxtPlugin((nuxtApp) => {
4747
<% } %>
4848

4949
<% if(options.appCheck) { %>
50-
if (process.client) {
51-
modules.push(VueFireAppCheck({
52-
...appConfig.vuefireOptions.appCheck,
53-
provider: '<%= options.appCheck.provider %>' === 'ReCaptchaV3'
54-
? new ReCaptchaV3Provider('<%= options.appCheck.key %>')
55-
: new CustomProvider({
56-
getToken: () => Promise.resolve({ token: '', expireTimeMillis: 1 })
57-
}),
58-
}))
59-
}
50+
modules.push(VueFireAppCheck({
51+
...appConfig.vuefireOptions.appCheck,
52+
provider: '<%= options.appCheck.provider %>' === 'ReCaptchaV3'
53+
? new ReCaptchaV3Provider('<%= options.appCheck.key %>')
54+
: new CustomProvider({
55+
getToken: () => Promise.resolve({ token: '', expireTimeMillis: 1 })
56+
}),
57+
}))
6058
<% } %>
6159

6260
nuxtApp.vueApp.use(VueFire, {

0 commit comments

Comments
 (0)