@umijs/plugins 4.0.0-canary.20220506.3 → 4.0.0-canary.20220507.2
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.
package/dist/qiankun/master.js
CHANGED
|
@@ -113,13 +113,16 @@ export const setMasterOptions = (newOpts) => options = ({ ...options, ...newOpts
|
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
|
+
let content = getFileContent(file);
|
|
117
|
+
if (!api.config.qiankun.externalQiankun) {
|
|
118
|
+
content = content.replace(/from 'qiankun'/g, `from '${(0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('qiankun/package')))}'`);
|
|
119
|
+
}
|
|
116
120
|
api.writeTmpFile({
|
|
117
121
|
path: file.replace(/\.tpl$/, ''),
|
|
118
|
-
content:
|
|
122
|
+
content: content
|
|
119
123
|
.replace('__USE_MODEL__', api.isPluginEnable('model')
|
|
120
124
|
? `import { useModel } from '@@/plugin-model'`
|
|
121
125
|
: `const useModel = null;`)
|
|
122
|
-
.replace(/from 'qiankun'/g, `from '${(0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('qiankun/package')))}'`)
|
|
123
126
|
.replace(/from 'lodash\//g, `from '${(0, plugin_utils_1.winPath)((0, path_1.dirname)(require.resolve('lodash/package')))}/`),
|
|
124
127
|
});
|
|
125
128
|
}
|
package/dist/qiankun.js
CHANGED
|
@@ -105,8 +105,8 @@ const recursiveSearch = (
|
|
|
105
105
|
if (routes[i].path === path) {
|
|
106
106
|
return routes[i];
|
|
107
107
|
}
|
|
108
|
-
if (routes[i].
|
|
109
|
-
const found = recursiveSearch(routes[i].
|
|
108
|
+
if (routes[i].children && routes[i].children?.length) {
|
|
109
|
+
const found = recursiveSearch(routes[i].children || [], path);
|
|
110
110
|
if (found) {
|
|
111
111
|
return found;
|
|
112
112
|
}
|
|
@@ -128,8 +128,8 @@ export function insertRoute(routes: IRouteProps[], microAppRoute: IRouteProps) {
|
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
found.exact = false;
|
|
131
|
-
found.
|
|
132
|
-
found.
|
|
131
|
+
found.children = found.children || [];
|
|
132
|
+
found.children.push(microAppRoute);
|
|
133
133
|
} else {
|
|
134
134
|
throw new Error(
|
|
135
135
|
`[plugin-qiankun]: path "${microAppRoute.insert}" not found`,
|
|
@@ -34,10 +34,10 @@ function patchMicroAppRouteComponent(routes: any[]) {
|
|
|
34
34
|
const rootRoute = routes.find((route) => route.path === '/');
|
|
35
35
|
if (rootRoute) {
|
|
36
36
|
// 如果根路由是叶子节点,则直接返回其父节点
|
|
37
|
-
if (!rootRoute.
|
|
37
|
+
if (!rootRoute.children) {
|
|
38
38
|
return routes;
|
|
39
39
|
}
|
|
40
|
-
return getRootRoutes(rootRoute.
|
|
40
|
+
return getRootRoutes(rootRoute.children);
|
|
41
41
|
}
|
|
42
42
|
return routes;
|
|
43
43
|
};
|
|
@@ -54,8 +54,8 @@ function patchMicroAppRouteComponent(routes: any[]) {
|
|
|
54
54
|
masterHistoryType,
|
|
55
55
|
routeBindingAlias,
|
|
56
56
|
});
|
|
57
|
-
if (route.
|
|
58
|
-
route.
|
|
57
|
+
if (route.children?.length) {
|
|
58
|
+
route.children.forEach(patchRoute);
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
|
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.20220507.2",
|
|
4
4
|
"description": "@umijs/plugins",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/plugins#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi-next/issues",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@ahooksjs/use-request": "^2.0.0",
|
|
26
26
|
"@ant-design/icons": "^4.7.0",
|
|
27
|
-
"@ant-design/pro-layout": "^6.
|
|
28
|
-
"@umijs/bundler-utils": "4.0.0-canary.
|
|
27
|
+
"@ant-design/pro-layout": "^6.38.0",
|
|
28
|
+
"@umijs/bundler-utils": "4.0.0-canary.20220507.2",
|
|
29
29
|
"antd-dayjs-webpack-plugin": "^1.0.6",
|
|
30
|
-
"axios": "^0.
|
|
30
|
+
"axios": "^0.27.2",
|
|
31
31
|
"babel-plugin-import": "^1.13.3",
|
|
32
|
-
"dayjs": "^1.11.
|
|
32
|
+
"dayjs": "^1.11.2",
|
|
33
33
|
"dva-core": "^2.0.4",
|
|
34
34
|
"dva-immer": "^1.0.0",
|
|
35
35
|
"dva-loading": "^3.0.22",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"moment": "^2.29.3",
|
|
40
40
|
"qiankun": "^2.7.0",
|
|
41
41
|
"react-intl": "3.12.1",
|
|
42
|
-
"react-redux": "^8.0.
|
|
42
|
+
"react-redux": "^8.0.1",
|
|
43
43
|
"redux": "^4.2.0",
|
|
44
44
|
"warning": "^4.0.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"umi": "4.0.0-canary.
|
|
47
|
+
"umi": "4.0.0-canary.20220507.2"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|