File tree 4 files changed +6
-3
lines changed
examples/extends-app/root/pages/index
packages/plugin-extends-app
4 files changed +6
-3
lines changed File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @alita/plugin-extends-app" ,
3
- "version" : " 3.2.2 " ,
3
+ "version" : " 3.0.1 " ,
4
4
"description" : " @alita/plugin-extends-app" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -31,10 +31,11 @@ export default (api: IApi) => {
31
31
api . modifyRoutes ( async ( memo ) => {
32
32
// 配置式不支持
33
33
if ( api . userConfig . routes ) return memo ;
34
+ const prefix = 'pages/' ;
34
35
const routes = getConventionRoutes ( {
35
36
base : otherPagesPath ,
36
37
exclude : api . config . conventionRoutes ?. exclude ,
37
- prefix : 'pages/' ,
38
+ prefix,
38
39
} ) ;
39
40
function localPath ( path : string ) {
40
41
if ( path . charAt ( 0 ) !== '.' ) {
@@ -102,7 +103,9 @@ export default (api: IApi) => {
102
103
routes [ id ] . routeProps = `routeProps['${ id } ']` ;
103
104
}
104
105
}
105
- memo [ id ] = routes [ id ] ;
106
+ // 同路由,则扩展覆盖原有的数据
107
+ const key = id . substring ( prefix . length ) ;
108
+ memo [ key ] = routes [ id ] ;
106
109
}
107
110
}
108
111
return memo ;
You can’t perform that action at this time.
0 commit comments