Merge branch 'chunk-output' into 'master'

Make event & create event & map async components

See merge request framasoft/mobilizon!146
This commit is contained in:
Thomas Citharel 2019-05-31 15:21:15 +02:00
commit 768dc57062
2 changed files with 11 additions and 6 deletions

View File

@ -1,9 +1,12 @@
import EventList from '@/views/Event/EventList.vue';
import Location from '@/views/Location.vue';
import CreateEvent from '@/views/Event/Create.vue';
import Event from '@/views/Event/Event.vue';
import { RouteConfig } from 'vue-router';
// tslint:disable:space-in-parens
const createEvent = () => import(/* webpackChunkName: "create-event" */ '@/views/Event/Create.vue');
const event = () => import(/* webpackChunkName: "event" */ '@/views/Event/Event.vue');
// tslint:enable
export enum EventRouteName {
EVENT_LIST = 'EventList',
CREATE_EVENT = 'CreateEvent',
@ -22,13 +25,13 @@ export const eventRoutes: RouteConfig[] = [
{
path: '/events/create',
name: EventRouteName.CREATE_EVENT,
component: CreateEvent,
component: createEvent,
meta: { requiredAuth: true },
},
{
path: '/events/:id/edit',
name: EventRouteName.EDIT_EVENT,
component: CreateEvent,
component: createEvent,
props: true,
meta: { requiredAuth: true },
},
@ -41,7 +44,7 @@ export const eventRoutes: RouteConfig[] = [
{
path: '/events/:uuid',
name: EventRouteName.EVENT,
component: Event,
component: event,
props: true,
meta: { requiredAuth: false },
},

View File

@ -249,7 +249,9 @@ import EventFullDate from '@/components/Event/EventFullDate.vue';
EventCard,
BIcon,
DateCalendarIcon,
'map-leaflet': () => import('@/components/Map.vue'),
// tslint:disable:space-in-parens
'map-leaflet': () => import(/* webpackChunkName: "map" */ '@/components/Map.vue'),
// tslint:enable
},
apollo: {
event: {