Skip to content

Commit

Permalink
chore: same route path
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuoni committed Aug 9, 2024
1 parent b8ba8c6 commit 9c1df6c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-extends-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alita/plugin-extends-app",
"version": "3.2.2",
"version": "3.0.1",
"description": "@alita/plugin-extends-app",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
7 changes: 5 additions & 2 deletions packages/plugin-extends-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ export default (api: IApi) => {
api.modifyRoutes(async (memo) => {
// 配置式不支持
if (api.userConfig.routes) return memo;
const prefix = 'pages/';
const routes = getConventionRoutes({
base: otherPagesPath,
exclude: api.config.conventionRoutes?.exclude,
prefix: 'pages/',
prefix,
});
function localPath(path: string) {
if (path.charAt(0) !== '.') {
Expand Down Expand Up @@ -102,7 +103,9 @@ export default (api: IApi) => {
routes[id].routeProps = `routeProps['${id}']`;
}
}
memo[id] = routes[id];
// 同路由,则扩展覆盖原有的数据
const key = id.substring(prefix.length);
memo[key] = routes[id];
}
}
return memo;
Expand Down

0 comments on commit 9c1df6c

Please sign in to comment.