From ded64e8dc25ded56468c4d6556edf9a7f75aca7c Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 11 Jul 2024 23:40:19 +0200 Subject: [PATCH] [UI Performance] Lazy initialization for router components. --- .../backend/http/webapp/src/router/index.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/platypush/backend/http/webapp/src/router/index.js b/platypush/backend/http/webapp/src/router/index.js index 85538f4796..8ac91e24bc 100644 --- a/platypush/backend/http/webapp/src/router/index.js +++ b/platypush/backend/http/webapp/src/router/index.js @@ -1,45 +1,39 @@ import { createWebHistory, createRouter } from "vue-router"; -import Dashboard from "@/views/Dashboard.vue"; -import NotFound from "@/views/NotFound"; -import Login from "@/views/Login"; -import Register from "@/views/Register"; -import Panel from "@/views/Panel"; -import Plugin from "@/views/Plugin"; const routes = [ { path: "/", name: "Panel", - component: Panel, + component: () => import(/* webpackChunkName: "panel" */ "@/views/Panel"), }, { path: "/dashboard/:name", name: "Dashboard", - component: Dashboard, + component: () => import(/* webpackChunkName: "dashboard" */ "@/views/Dashboard"), }, { path: "/plugin/:plugin", name: "Plugin", - component: Plugin, + component: () => import(/* webpackChunkName: "plugin" */ "@/views/Plugin"), }, { path: "/login", name: "Login", - component: Login, + component: () => import(/* webpackChunkName: "login" */ "@/views/Login"), }, { path: "/register", name: "Register", - component: Register, + component: () => import(/* webpackChunkName: "register" */ "@/views/Register"), }, { path: "/:catchAll(.*)", - component: NotFound, + component: () => import(/* webpackChunkName: "notfound" */ "@/views/NotFound"), }, ];