@umijs/plugins 4.0.0-canary.20251110.1 → 4.0.0-canary.20251113.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/slave.js +19 -5
- package/package.json +3 -3
package/dist/qiankun/slave.js
CHANGED
|
@@ -172,7 +172,7 @@ export interface IRuntimeConfig {
|
|
|
172
172
|
];
|
|
173
173
|
});
|
|
174
174
|
api.chainWebpack((config, { ssr }) => {
|
|
175
|
-
if (ssr) {
|
|
175
|
+
if (ssr || api.userConfig.utoopack) {
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
(0, import_assert.default)(api.pkg.name, "You should have name in package.json.");
|
|
@@ -202,20 +202,34 @@ export interface IRuntimeConfig {
|
|
|
202
202
|
}
|
|
203
203
|
];
|
|
204
204
|
});
|
|
205
|
-
api.addEntryCode(() =>
|
|
206
|
-
|
|
205
|
+
api.addEntryCode(() => {
|
|
206
|
+
var _a, _b;
|
|
207
|
+
const appName = ((_b = (_a = api.config.qiankun) == null ? void 0 : _a.slave) == null ? void 0 : _b.appName) || api.pkg.name;
|
|
208
|
+
return [
|
|
209
|
+
`
|
|
207
210
|
const qiankun_noop = () => new Error('qiankun lifecycle is not available for server runtime!');
|
|
208
211
|
const isServer = typeof window === 'undefined';
|
|
209
212
|
export const bootstrap = isServer ? qiankun_noop: qiankun_genBootstrap(render);
|
|
210
213
|
export const mount = isServer ? qiankun_noop : qiankun_genMount('${api.config.mountElementId}');
|
|
211
214
|
export const unmount = isServer ? qiankun_noop : qiankun_genUnmount('${api.config.mountElementId}');
|
|
212
215
|
export const update = isServer ? qiankun_noop : qiankun_genUpdate();
|
|
216
|
+
|
|
217
|
+
if (!isServer && ${Boolean(api.userConfig.utoopack)}) {
|
|
218
|
+
window['${appName}'] = {
|
|
219
|
+
bootstrap,
|
|
220
|
+
mount,
|
|
221
|
+
unmount,
|
|
222
|
+
update,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
213
226
|
// 增加 ssr 的判断
|
|
214
227
|
if (!isServer && !window.__POWERED_BY_QIANKUN__) {
|
|
215
228
|
bootstrap().then(mount);
|
|
216
229
|
}
|
|
217
|
-
|
|
218
|
-
|
|
230
|
+
`
|
|
231
|
+
];
|
|
232
|
+
});
|
|
219
233
|
function getFileContent(file) {
|
|
220
234
|
return (0, import_fs.readFileSync)(
|
|
221
235
|
(0, import_path.join)(__dirname, "../../libs/qiankun/slave", file),
|
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.20251113.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",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"styled-components": "6.1.1",
|
|
46
46
|
"tslib": "^2",
|
|
47
47
|
"warning": "^4.0.3",
|
|
48
|
-
"@umijs/bundler-utils": "4.0.0-canary.
|
|
48
|
+
"@umijs/bundler-utils": "4.0.0-canary.20251113.1",
|
|
49
49
|
"@umijs/valtio": "1.0.4"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"antd": "^4.24.1",
|
|
53
|
-
"umi": "4.0.0-canary.
|
|
53
|
+
"umi": "4.0.0-canary.20251113.1"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|