import Vue from ‘vue‘ import Router from ‘vue-router‘ import Promise from ‘promise-polyfill‘ if (!window.Promise) { window.Promise = Promise; } const Hello = r => require.ensure([], () => r(require(‘../pages/Hello‘)), ‘group-b‘) const Index = r => require.ensure([], () => r(require(‘../pages/Index‘)), ‘group-a‘) Vue.use(Router) export default new Router({ routes: [ { path: ‘/‘, name: ‘Index‘, component: Index }, { path: ‘/hello‘, name: ‘Hello‘, component: Hello } ] })