Skip to content

Commit 86c276e

Browse files
committed
fix: workaround vite resolving issue
1 parent 6698c04 commit 86c276e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

packages/nuxt/src/module.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,31 @@ const VueFire: NuxtModule<VueFireNuxtModuleOptions> =
260260
})
261261
}
262262
},
263+
264+
// workaround for vite
265+
hooks: {
266+
'vite:extendConfig': (viteInlineConfig, env) => {
267+
viteInlineConfig.resolve ??= {}
268+
viteInlineConfig.resolve.dedupe ??= []
269+
const deps = [
270+
// 'vuefire',
271+
// 'nuxt-vuefire',
272+
'firebase',
273+
'firebase/app',
274+
'@firebase/app',
275+
'firebase/firestore',
276+
'@firebase/firestore',
277+
'firebase/auth',
278+
'@firebase/auth',
279+
'@firebase/component',
280+
]
281+
viteInlineConfig.resolve.dedupe.push(...deps)
282+
283+
viteInlineConfig.optimizeDeps ??= {}
284+
viteInlineConfig.optimizeDeps.exclude ??= []
285+
viteInlineConfig.optimizeDeps.exclude.push(...deps)
286+
},
287+
},
263288
})
264289

265290
// just to have autocomplete and errors

0 commit comments

Comments
 (0)