@umijs/plugins 4.0.0-canary.20220929.2 → 4.0.0-canary.20221012.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useMatch } from 'umi';
|
|
2
3
|
import { MicroApp } from './MicroApp';
|
|
3
4
|
|
|
4
5
|
export function getMicroAppRouteComponent(opts: {
|
|
@@ -10,11 +11,13 @@ export function getMicroAppRouteComponent(opts: {
|
|
|
10
11
|
}) {
|
|
11
12
|
const { base, masterHistoryType, appName, routeProps, routePath } = opts;
|
|
12
13
|
const RouteComponent = () => {
|
|
14
|
+
const match = useMatch(routePath);
|
|
15
|
+
const url = match.pathnameBase;
|
|
13
16
|
// 默认取静态配置的 base
|
|
14
17
|
let umiConfigBase = base === '/' ? '' : base;
|
|
15
18
|
|
|
16
19
|
// 拼接子应用挂载路由
|
|
17
|
-
let runtimeMatchedBase = umiConfigBase +
|
|
20
|
+
let runtimeMatchedBase = umiConfigBase + (url.endsWith('/') ? url.substr(0, url.length - 1) : url);
|
|
18
21
|
|
|
19
22
|
{{#dynamicRoot}}
|
|
20
23
|
// @see https://github.com/umijs/umi/blob/master/packages/preset-built-in/src/plugins/commands/htmlUtils.ts#L102
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/plugins",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.20221012.1",
|
|
4
4
|
"description": "@umijs/plugins",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/plugins#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@ant-design/antd-theme-variable": "^1.0.0",
|
|
28
28
|
"@ant-design/icons": "^4.7.0",
|
|
29
29
|
"@ant-design/pro-components": "^2.0.1",
|
|
30
|
-
"@umijs/bundler-utils": "4.0.0-canary.
|
|
30
|
+
"@umijs/bundler-utils": "4.0.0-canary.20221012.1",
|
|
31
31
|
"@umijs/valtio": "^1.0.0",
|
|
32
32
|
"antd-dayjs-webpack-plugin": "^1.0.6",
|
|
33
33
|
"axios": "^0.27.2",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"warning": "^4.0.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"umi": "4.0.0-canary.
|
|
50
|
+
"umi": "4.0.0-canary.20221012.1"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|