Skip to content

Commit 9c1df6c

Browse files
committed
chore: same route path
1 parent b8ba8c6 commit 9c1df6c

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

packages/plugin-extends-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",

packages/plugin-extends-app/src/index.ts

+5-2
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)