File tree Expand file tree Collapse file tree 4 files changed +6
-3
lines changed
examples/extends-app/root/pages/index
packages/plugin-extends-app Expand file tree Collapse file tree 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 11{
22 "name" : " @alita/plugin-extends-app" ,
3- "version" : " 3.2.2 " ,
3+ "version" : " 3.0.1 " ,
44 "description" : " @alita/plugin-extends-app" ,
55 "main" : " dist/index.js" ,
66 "types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -31,10 +31,11 @@ export default (api: IApi) => {
3131 api . modifyRoutes ( async ( memo ) => {
3232 // 配置式不支持
3333 if ( api . userConfig . routes ) return memo ;
34+ const prefix = 'pages/' ;
3435 const routes = getConventionRoutes ( {
3536 base : otherPagesPath ,
3637 exclude : api . config . conventionRoutes ?. exclude ,
37- prefix : 'pages/' ,
38+ prefix,
3839 } ) ;
3940 function localPath ( path : string ) {
4041 if ( path . charAt ( 0 ) !== '.' ) {
@@ -102,7 +103,9 @@ export default (api: IApi) => {
102103 routes [ id ] . routeProps = `routeProps['${ id } ']` ;
103104 }
104105 }
105- memo [ id ] = routes [ id ] ;
106+ // 同路由,则扩展覆盖原有的数据
107+ const key = id . substring ( prefix . length ) ;
108+ memo [ key ] = routes [ id ] ;
106109 }
107110 }
108111 return memo ;
You can’t perform that action at this time.
0 commit comments