Lazy-load dashboard and settings views to reduce initial bundle size
Convert dashboard and settings component imports from static to dynamic imports using arrow functions, improving initial load performance by code-splitting these routes.
This commit is contained in:
@@ -1,15 +1,16 @@
|
|||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
import Home from '../views/Home.vue'
|
import Home from '../views/Home.vue'
|
||||||
import DashboardLayout from '../views/dashboard/DashboardLayout.vue'
|
|
||||||
import Overview from '../views/dashboard/Overview.vue'
|
|
||||||
import SavedStations from '../views/dashboard/SavedStations.vue'
|
|
||||||
import Preferences from '../views/dashboard/Preferences.vue'
|
|
||||||
import SettingsLayout from '../views/dashboard/settings/SettingsLayout.vue'
|
|
||||||
import Profile from '../views/dashboard/settings/Profile.vue'
|
|
||||||
import Security from '../views/dashboard/settings/Security.vue'
|
|
||||||
import Appearance from '../views/dashboard/settings/Appearance.vue'
|
|
||||||
import { useAuth } from '../composables/useAuth.js'
|
import { useAuth } from '../composables/useAuth.js'
|
||||||
|
|
||||||
|
const DashboardLayout = () => import('../views/dashboard/DashboardLayout.vue')
|
||||||
|
const Overview = () => import('../views/dashboard/Overview.vue')
|
||||||
|
const SavedStations = () => import('../views/dashboard/SavedStations.vue')
|
||||||
|
const Preferences = () => import('../views/dashboard/Preferences.vue')
|
||||||
|
const SettingsLayout = () => import('../views/dashboard/settings/SettingsLayout.vue')
|
||||||
|
const Profile = () => import('../views/dashboard/settings/Profile.vue')
|
||||||
|
const Security = () => import('../views/dashboard/settings/Security.vue')
|
||||||
|
const Appearance = () => import('../views/dashboard/settings/Appearance.vue')
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{ path: '/', component: Home, name: 'home' },
|
{ path: '/', component: Home, name: 'home' },
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user