Skip to content

Commit

Permalink
feat: demonstrate route-level code splitting in generated file
Browse files Browse the repository at this point in the history
close #1928
  • Loading branch information
yyx990803 committed Jul 24, 2018
1 parent e9d01eb commit 7d46db9
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import About from './views/About.vue'

Vue.use(Router)

Expand All @@ -15,7 +14,13 @@ export default new Router({
{
path: '/about',
name: 'about',
component: About
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(
/* webpackChunkName: "about" */
'./views/About.vue'
)
}
]
})

0 comments on commit 7d46db9

Please sign in to comment.