Skip to content

Commit ddb007e

Browse files
committed
test: add tests for lazy components
1 parent 6d42091 commit ddb007e

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

generator/codemods/router/__testfixtures__/create-history.input.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import VueRouter from 'vue-router';
22
import Home from '../views/Home.vue';
3-
import About from '../views/About.vue';
43

54
const routes = [
65
{
@@ -11,7 +10,7 @@ const routes = [
1110
{
1211
path: '/about',
1312
name: 'about',
14-
component: About
13+
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
1514
},
1615
];
1716

generator/codemods/router/__testfixtures__/create-history.output.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { createRouter, createWebHistory } from 'vue-router';
22
import Home from '../views/Home.vue';
3-
import About from '../views/About.vue';
43

54
const routes = [
65
{
@@ -11,7 +10,7 @@ const routes = [
1110
{
1211
path: '/about',
1312
name: 'about',
14-
component: About
13+
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
1514
},
1615
];
1716

generator/codemods/router/__testfixtures__/create-router.input.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import VueRouter from 'vue-router';
22
import Home from '../views/Home.vue';
3-
import About from '../views/About.vue';
43

54
const routes = [
65
{
@@ -11,7 +10,7 @@ const routes = [
1110
{
1211
path: '/about',
1312
name: 'about',
14-
component: About
13+
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
1514
},
1615
];
1716

generator/codemods/router/__testfixtures__/create-router.output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const routes = [
1111
{
1212
path: '/about',
1313
name: 'about',
14-
component: About
14+
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
1515
},
1616
];
1717

0 commit comments

Comments
 (0)