@umijs/plugins 4.0.0-canary.20240507.1 → 4.0.0-canary.20240509.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.
@@ -205,13 +205,13 @@ export interface IRuntimeConfig {
205
205
  api.addEntryCode(() => [
206
206
  `
207
207
  const qiankun_noop = () => new Error('qiankun lifecycle is not available for server runtime!');
208
- const ssrBuildTarget = process.env.SSR_BUILD_TARGET;
209
- export const bootstrap = ssrBuildTarget ? qiankun_noop: qiankun_genBootstrap(render);
210
- export const mount = ssrBuildTarget ? qiankun_noop : qiankun_genMount('${api.config.mountElementId}');
211
- export const unmount = ssrBuildTarget ? qiankun_noop : qiankun_genUnmount('${api.config.mountElementId}');
212
- export const update = ssrBuildTarget ? qiankun_noop : qiankun_genUpdate();
208
+ const isServer = typeof window === 'undefined';
209
+ export const bootstrap = isServer ? qiankun_noop: qiankun_genBootstrap(render);
210
+ export const mount = isServer ? qiankun_noop : qiankun_genMount('${api.config.mountElementId}');
211
+ export const unmount = isServer ? qiankun_noop : qiankun_genUnmount('${api.config.mountElementId}');
212
+ export const update = isServer ? qiankun_noop : qiankun_genUpdate();
213
213
  // 增加 ssr 的判断
214
- if (typeof window !== 'undefined' && !window.__POWERED_BY_QIANKUN__) {
214
+ if (!isServer && !window.__POWERED_BY_QIANKUN__) {
215
215
  bootstrap().then(mount);
216
216
  }
217
217
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.0-canary.20240507.1",
3
+ "version": "4.0.0-canary.20240509.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.20240507.1",
48
+ "@umijs/bundler-utils": "4.0.0-canary.20240509.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.20240507.1"
53
+ "umi": "4.0.0-canary.20240509.1"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"