From aefac3a25459e749a387bc87d6c0cd05723eb65d Mon Sep 17 00:00:00 2001 From: hfidelis Date: Sun, 18 Feb 2024 01:26:25 -0300 Subject: [PATCH] fix: lazy loading home and attempt to fix baseUrl --- src/router/index.ts | 5 ++--- vite.config.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index a49ae50..88adb75 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,5 +1,4 @@ import { createRouter, createWebHistory } from 'vue-router' -import HomeView from '../views/HomeView.vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -7,7 +6,7 @@ const router = createRouter({ { path: '/', name: 'home', - component: HomeView + component: () => import('@/views/HomeView.vue') }, { path: '/about', @@ -15,7 +14,7 @@ const router = createRouter({ // route level code-splitting // this generates a separate chunk (About.[hash].js) for this route // which is lazy-loaded when the route is visited. - component: () => import('../views/AboutView.vue') + component: () => import('@/views/AboutView.vue') } ] }) diff --git a/vite.config.ts b/vite.config.ts index a2b027e..39280e3 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,5 +13,5 @@ export default defineConfig({ '@': fileURLToPath(new URL('./src', import.meta.url)) } }, - base: '/' + base: './' })