diff --git a/frontend/src/router.js b/frontend/src/router.js index 71b3ceb..338ed39 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -1,14 +1,14 @@ import Vue from "vue"; import Router from "vue-router"; -import Home from "./views/Home.vue"; -import StartNew from "./views/StartNew.vue"; -import Observation from "./views/Observation.vue"; -import Stats from "./views/Stats.vue"; -import NewSite from "./views/NewSite.vue"; -import NewTutor from "./views/NewTutor.vue"; -import ViewObservations from "./views/ViewObservations.vue"; -import ObservationComplete from "./views/ObservationComplete.vue"; -import DBError from "./views/DatabaseUnavailable.vue" +const Home = () => import("./views/Home.vue"); +const StartNew = () => import("./views/StartNew.vue"); +const Observation = () => import("./views/Observation.vue"); +const Stats = () => import("./views/Stats.vue"); +const NewSite = () => import("./views/NewSite.vue"); +const NewTutor = () => import("./views/NewTutor.vue"); +const ViewObservations = () => import("./views/ViewObservations.vue"); +const ObservationComplete = () => import("./views/ObservationComplete.vue"); +const DBError = () => import("./views/DatabaseUnavailable.vue"); Vue.use(Router); diff --git a/frontend/vue.config.js b/frontend/vue.config.js index b1e8f76..7fbc0a4 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -1,4 +1,12 @@ // vue.config.js module.exports = { - outputDir: 'target/dist' -} + outputDir: 'target/dist', + configureWebpack:{ + optimization: { + splitChunks: { + minSize: 10000, + maxSize: 250000 + } + } + } +};