Skip to content
This repository was archived by the owner on Sep 24, 2020. It is now read-only.

Commit e30b25d

Browse files
committed
rebase stage 1
1 parent 0c0fbd6 commit e30b25d

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

template/config/webpack.config.module.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const purifyCss = new PurifyCSSPlugin({
2222
}
2323
});
2424

25+
webpackConfig.entry.main = helpers.root('/src/module.ts');
26+
2527
webpackConfig.output = {
2628
path: helpers.root('/dist'),
2729
filename: 'index.js',

template/src/module.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import {RouteConfig} from 'vue-router';
2+
3+
const homeComponent = () => import('./components/home').then(({HomeComponent}) => HomeComponent);
4+
const aboutComponent = () => import('./components/about').then(({AboutComponent}) => AboutComponent);
5+
const listComponent = () => import('./components/list').then(({ListComponent}) => ListComponent);
6+
7+
8+
export function createRoutes(prefix: string = ''): RouteConfig[] {
9+
return [
10+
{
11+
path: prefix + '/',
12+
component: homeComponent,
13+
},
14+
{
15+
path: prefix + '/about',
16+
component: aboutComponent,
17+
},
18+
{
19+
path: prefix + '/list',
20+
component: listComponent,
21+
}
22+
];
23+
}

0 commit comments

Comments
 (0)