From a0085b70a3d58323cf6d321a91fcf857f7bd3657 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 30 Jan 2023 10:22:15 -0800 Subject: [PATCH] fix(nuxt): dedupe vue-router (#18626) --- packages/nuxt/src/pages/module.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/nuxt/src/pages/module.ts b/packages/nuxt/src/pages/module.ts index b571dd5b14..a494277df7 100644 --- a/packages/nuxt/src/pages/module.ts +++ b/packages/nuxt/src/pages/module.ts @@ -186,6 +186,10 @@ export default defineNuxtModule({ nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || [] nuxt.options.vite.optimizeDeps.include.push('vue-router') + nuxt.options.vite.resolve = nuxt.options.vite.resolve || {} + nuxt.options.vite.resolve.dedupe = nuxt.options.vite.resolve.dedupe || [] + nuxt.options.vite.resolve.dedupe.push('vue-router') + // Add router options template addTemplate({ filename: 'router.options.mjs',