@umijs/plugins 4.0.0-canary.20220323.1 → 4.0.0-canary.20220325.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.
package/dist/qiankun/master.js
CHANGED
|
@@ -91,7 +91,6 @@ export const setMasterOptions = (newOpts) => options = ({ ...options, ...newOpts
|
|
|
91
91
|
path: file.replace(/\.tpl$/, ''),
|
|
92
92
|
tpl: getFileContent(file),
|
|
93
93
|
context: {
|
|
94
|
-
runtimeHistory: api.config.runtimeHistory,
|
|
95
94
|
dynamicRoot: false,
|
|
96
95
|
hasModelPlugin: api.isPluginEnable('model'),
|
|
97
96
|
// dynamicRoot:
|
package/dist/qiankun/slave.js
CHANGED
|
@@ -35,15 +35,14 @@ exports.default = (api) => {
|
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
api.modifyDefaultConfig((memo) => {
|
|
38
|
-
var _a, _b, _c;
|
|
38
|
+
var _a, _b, _c, _d;
|
|
39
39
|
const initialSlaveOptions = Object.assign(Object.assign({ devSourceMap: true }, JSON.parse(process.env.INITIAL_QIANKUN_SLAVE_OPTIONS || '{}')), (memo.qiankun || {}).slave);
|
|
40
40
|
const modifiedDefaultConfig = Object.assign(Object.assign({}, memo), {
|
|
41
41
|
// 默认开启 runtimePublicPath,避免出现 dynamic import 场景子应用资源地址出问题
|
|
42
|
-
runtimePublicPath: true,
|
|
43
|
-
// TODO: runtimeHistory
|
|
44
|
-
runtimeHistory: {}, qiankun: Object.assign(Object.assign({}, memo.qiankun), { slave: initialSlaveOptions }) });
|
|
42
|
+
runtimePublicPath: true, qiankun: Object.assign(Object.assign({}, memo.qiankun), { slave: initialSlaveOptions }) });
|
|
45
43
|
const shouldNotModifyDefaultBase = (_c = (_b = (_a = api.userConfig.qiankun) === null || _a === void 0 ? void 0 : _a.slave) === null || _b === void 0 ? void 0 : _b.shouldNotModifyDefaultBase) !== null && _c !== void 0 ? _c : initialSlaveOptions.shouldNotModifyDefaultBase;
|
|
46
|
-
|
|
44
|
+
const historyType = ((_d = api.userConfig.history) === null || _d === void 0 ? void 0 : _d.type) || 'browser';
|
|
45
|
+
if (!shouldNotModifyDefaultBase && historyType !== 'hash') {
|
|
47
46
|
// @ts-ignore
|
|
48
47
|
modifiedDefaultConfig.base = `/${api.pkg.name}`;
|
|
49
48
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MicroApp } from './MicroApp';
|
|
3
|
-
{{#runtimeHistory}}
|
|
4
|
-
import { getCreateHistoryOptions } from 'umi';
|
|
5
|
-
{{/runtimeHistory}}
|
|
6
3
|
import { useLocation } from 'umi';
|
|
7
4
|
|
|
8
5
|
export function getMicroAppRouteComponent(opts: {
|
|
@@ -18,12 +15,6 @@ export function getMicroAppRouteComponent(opts: {
|
|
|
18
15
|
// 默认取静态配置的 base
|
|
19
16
|
let umiConfigBase = base === '/' ? '' : base;
|
|
20
17
|
|
|
21
|
-
{{#runtimeHistory}}
|
|
22
|
-
// 存在 getCreateHistoryOptions 说明当前应用开启了 runtimeHistory,此时取运行时的 history 配置的 basename
|
|
23
|
-
const { basename = '/' } = getCreateHistoryOptions();
|
|
24
|
-
umiConfigBase = basename === '/' ? '' : basename;
|
|
25
|
-
{{/runtimeHistory}}
|
|
26
|
-
|
|
27
18
|
let runtimeMatchedBase =
|
|
28
19
|
umiConfigBase + (url.endsWith('/') ? url.substr(0, url.length - 1) : url);
|
|
29
20
|
|
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.20220325.1",
|
|
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",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@ahooksjs/use-request": "^2.0.0",
|
|
26
26
|
"@ant-design/icons": "^4.7.0",
|
|
27
27
|
"@ant-design/pro-layout": "^6.34.6",
|
|
28
|
-
"@umijs/bundler-utils": "4.0.0-canary.
|
|
28
|
+
"@umijs/bundler-utils": "4.0.0-canary.20220325.1",
|
|
29
29
|
"antd-dayjs-webpack-plugin": "^1.0.6",
|
|
30
30
|
"axios": "^0.26.1",
|
|
31
31
|
"babel-plugin-import": "^1.13.3",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"warning": "^4.0.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"umi": "4.0.0-canary.
|
|
47
|
+
"umi": "4.0.0-canary.20220325.1"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|