@umijs/plugins 4.0.0-canary.20220325.1 → 4.0.0-rc.11

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.
@@ -30,7 +30,7 @@ exports.default = (api) => {
30
30
  import React from 'react';
31
31
  import { useModel } from '@@/plugin-model';
32
32
  ${loading
33
- ? `import Loading from ${loading}`
33
+ ? `import Loading from '${loading}'`
34
34
  : `function Loading() { return <div>loading</div>; }`}
35
35
  export default function InitialStateProvider(props: any) {
36
36
  const appLoaded = React.useRef(false);
@@ -57,17 +57,15 @@ exports.default = (api) => {
57
57
  }
58
58
  return config;
59
59
  });
60
- // api.modifyPublicPathStr((publicPathStr) => {
61
- // const { runtimePublicPath } = api.config;
62
- // const { shouldNotModifyRuntimePublicPath } = (api.config.qiankun || {})
63
- // .slave!;
64
- // if (runtimePublicPath === true && !shouldNotModifyRuntimePublicPath) {
65
- // return `window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ || "${
66
- // api.config.publicPath || '/'
67
- // }"`;
68
- // }
69
- // return publicPathStr;
70
- // });
60
+ api.addHTMLHeadScripts(() => {
61
+ var _a;
62
+ const dontModify = (_a = api.config.qiankun) === null || _a === void 0 ? void 0 : _a.shouldNotModifyRuntimePublicPath;
63
+ return dontModify
64
+ ? []
65
+ : [
66
+ `window.publicPath = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ || "${api.config.publicPath || '/'}";`,
67
+ ];
68
+ });
71
69
  api.chainWebpack((config) => {
72
70
  (0, assert_1.default)(api.pkg.name, 'You should have name in package.json.');
73
71
  const { shouldNotAddLibraryChunkName } = (api.config.qiankun || {}).slave;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.0-canary.20220325.1",
3
+ "version": "4.0.0-rc.11",
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.20220325.1",
28
+ "@umijs/bundler-utils": "4.0.0-rc.11",
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.20220325.1"
47
+ "umi": "4.0.0-rc.11"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"