From 0e8f13dd102849013b183accb93ded79cbd5f701 Mon Sep 17 00:00:00 2001 From: Zhao Bin <413853119@qq.com> Date: Wed, 28 Feb 2024 19:10:32 +0800 Subject: [PATCH] fix(vitesse): fix unplugin-vue-router usage --- src/main.ts | 2 +- tsconfig.json | 1 + vite.config.ts | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 86f80fe..9338802 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,7 +2,7 @@ import { ViteSSG } from 'vite-ssg' import { setupLayouts } from 'virtual:generated-layouts' // import Previewer from 'virtual:vue-component-preview' -import { routes } from 'vue-router/auto/routes' +import { routes } from 'vue-router/auto-routes' import App from './App.vue' import type { UserModule } from './types' diff --git a/tsconfig.json b/tsconfig.json index 7d55553..6da2c40 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,6 +20,7 @@ "vite/client", "vue/ref-macros", "vite-plugin-vue-layouts/client", + "unplugin-vue-router/client", "vite-plugin-pwa/client", "unplugin-vue-macros/macros-global", "vuepress/client-types" diff --git a/vite.config.ts b/vite.config.ts index 24bd2ca..37e9863 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -36,7 +36,7 @@ export default defineConfig({ // https://github.com/posva/unplugin-vue-router VueRouter({ - extensions: ['vue', 'md'], + extensions: ['.vue', '.md'], dts: 'src/typed-router.d.ts', routesFolder: [ { src: 'src/pages', path: '' }, @@ -54,7 +54,6 @@ export default defineConfig({ AutoImport({ imports: [ 'vue', - 'vue-router', 'vue-i18n', '@vueuse/head', '@vueuse/core',