changeset 466:e3035621cc52

refac: Small improvement of loading time with code splitting At present when a build is done, webpack complains about sizes of packages. Small improvements for that with code splitting done
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 22 Aug 2018 17:30:12 +0200
parents ab07eb290fa3
children 73c7b2d6246e
files client/src/router.js
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/router.js	Wed Aug 22 17:21:25 2018 +0200
+++ b/client/src/router.js	Wed Aug 22 17:30:12 2018 +0200
@@ -1,11 +1,12 @@
 import Vue from "vue";
 import Router from "vue-router";
-import Login from "./views/Login.vue";
-import Users from "./views/Users.vue";
-import Main from "./views/Main.vue";
 import store from "./store";
 import { sessionStillActive, toMillisFromString } from "./lib/session";
 
+const Login = () => import("./views/Login.vue");
+const Main = () => import("./views/Main.vue");
+const Users = () => import("./views/Users.vue");
+
 Vue.use(Router);
 
 const router = new Router({