Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/nuxt/src/pages/module.ts
Original file line numberDiff line numberDiff line change
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