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

Commit

Permalink
fix(nuxt): add vue-router to optimized deps (#8544)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 2, 2022
1 parent 80871e7 commit 28ffb7f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/nuxt/src/pages/module.ts
Expand Up @@ -162,6 +162,11 @@ export default defineNuxtModule({
getContents: () => 'export { useRoute } from \'vue-router\''
})

// Optimize vue-router to ensure we share the same injection symbol
nuxt.options.vite.optimizeDeps = nuxt.options.vite.optimizeDeps || {}
nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || []
nuxt.options.vite.optimizeDeps.include.push('vue-router')

// Add router options template
addTemplate({
filename: 'router.options.mjs',
Expand Down

0 comments on commit 28ffb7f

Please sign in to comment.