Skip to content

Commit aefac3a

Browse files
committed
fix: lazy loading home and attempt to fix baseUrl
1 parent 565a775 commit aefac3a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/router/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
import { createRouter, createWebHistory } from 'vue-router'
2-
import HomeView from '../views/HomeView.vue'
32

43
const router = createRouter({
54
history: createWebHistory(import.meta.env.BASE_URL),
65
routes: [
76
{
87
path: '/',
98
name: 'home',
10-
component: HomeView
9+
component: () => import('@/views/HomeView.vue')
1110
},
1211
{
1312
path: '/about',
1413
name: 'about',
1514
// route level code-splitting
1615
// this generates a separate chunk (About.[hash].js) for this route
1716
// which is lazy-loaded when the route is visited.
18-
component: () => import('../views/AboutView.vue')
17+
component: () => import('@/views/AboutView.vue')
1918
}
2019
]
2120
})

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export default defineConfig({
1313
'@': fileURLToPath(new URL('./src', import.meta.url))
1414
}
1515
},
16-
base: '/'
16+
base: './'
1717
})

0 commit comments

Comments
 (0)