Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

Commit 28ffb7f

Browse files
authored
fix(nuxt): add vue-router to optimized deps (#8544)
1 parent 80871e7 commit 28ffb7f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/nuxt/src/pages/module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ export default defineNuxtModule({
162162
getContents: () => 'export { useRoute } from \'vue-router\''
163163
})
164164

165+
// Optimize vue-router to ensure we share the same injection symbol
166+
nuxt.options.vite.optimizeDeps = nuxt.options.vite.optimizeDeps || {}
167+
nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || []
168+
nuxt.options.vite.optimizeDeps.include.push('vue-router')
169+
165170
// Add router options template
166171
addTemplate({
167172
filename: 'router.options.mjs',

0 commit comments

Comments
 (0)