Enabled lazy component loading.

This commit is contained in:
neviyn 2018-10-09 14:26:12 +01:00
parent ed82e5641b
commit c8ddbcaabc
2 changed files with 19 additions and 11 deletions

View File

@ -1,14 +1,14 @@
import Vue from "vue"; import Vue from "vue";
import Router from "vue-router"; import Router from "vue-router";
import Home from "./views/Home.vue"; const Home = () => import("./views/Home.vue");
import StartNew from "./views/StartNew.vue"; const StartNew = () => import("./views/StartNew.vue");
import Observation from "./views/Observation.vue"; const Observation = () => import("./views/Observation.vue");
import Stats from "./views/Stats.vue"; const Stats = () => import("./views/Stats.vue");
import NewSite from "./views/NewSite.vue"; const NewSite = () => import("./views/NewSite.vue");
import NewTutor from "./views/NewTutor.vue"; const NewTutor = () => import("./views/NewTutor.vue");
import ViewObservations from "./views/ViewObservations.vue"; const ViewObservations = () => import("./views/ViewObservations.vue");
import ObservationComplete from "./views/ObservationComplete.vue"; const ObservationComplete = () => import("./views/ObservationComplete.vue");
import DBError from "./views/DatabaseUnavailable.vue" const DBError = () => import("./views/DatabaseUnavailable.vue");
Vue.use(Router); Vue.use(Router);

View File

@ -1,4 +1,12 @@
// vue.config.js // vue.config.js
module.exports = { module.exports = {
outputDir: 'target/dist' outputDir: 'target/dist',
} configureWebpack:{
optimization: {
splitChunks: {
minSize: 10000,
maxSize: 250000
}
}
}
};