@umijs/plugins 4.0.21 → 4.0.22

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/dva.js CHANGED
@@ -41,7 +41,8 @@ var dva_default = (api) => {
41
41
  schema(Joi) {
42
42
  return Joi.alternatives().try(Joi.object({
43
43
  extraModels: Joi.array().items(Joi.string()),
44
- immer: Joi.object()
44
+ immer: Joi.object(),
45
+ skipModelValidate: Joi.boolean()
45
46
  }), Joi.boolean().invalid(true));
46
47
  }
47
48
  },
@@ -192,6 +193,8 @@ export { getDvaApp } from './dva';
192
193
  function getModelUtil(api) {
193
194
  return new import_modelUtils.ModelUtils(api, {
194
195
  contentTest(content) {
196
+ if (api == null ? void 0 : api.config.dva.skipModelValidate)
197
+ return true;
195
198
  return content.startsWith("// @dva-model");
196
199
  },
197
200
  astTest({ node, content }) {
@@ -122,7 +122,7 @@ export interface IRuntimeConfig {
122
122
  });
123
123
  });
124
124
  api.modifyDefaultConfig((memo) => {
125
- var _a, _b, _c;
125
+ var _a, _b, _c, _d, _e;
126
126
  const initialSlaveOptions = {
127
127
  devSourceMap: true,
128
128
  ...JSON.parse(process.env.INITIAL_QIANKUN_SLAVE_OPTIONS || "{}"),
@@ -141,17 +141,13 @@ export interface IRuntimeConfig {
141
141
  if (!shouldNotModifyDefaultBase && historyType !== "hash") {
142
142
  modifiedDefaultConfig.base = `/${api.pkg.name}`;
143
143
  }
144
- return modifiedDefaultConfig;
145
- });
146
- api.modifyConfig((config) => {
147
- var _a, _b;
148
- if (config.mfsu !== false) {
149
- config.mfsu = {
150
- ...config.mfsu,
151
- mfName: ((_a = config.mfsu) == null ? void 0 : _a.mfName) || `mf_${(_b = api.pkg.name) == null ? void 0 : _b.replace(/^@/, "").replace(/\W/g, "_")}`
144
+ if (modifiedDefaultConfig.mfsu !== false) {
145
+ modifiedDefaultConfig.mfsu = {
146
+ ...modifiedDefaultConfig.mfsu,
147
+ mfName: ((_d = modifiedDefaultConfig.mfsu) == null ? void 0 : _d.mfName) || `mf_${(_e = api.pkg.name) == null ? void 0 : _e.replace(/^@/, "").replace(/\W/g, "_")}`
152
148
  };
153
149
  }
154
- return config;
150
+ return modifiedDefaultConfig;
155
151
  });
156
152
  api.addHTMLHeadScripts(() => {
157
153
  var _a, _b;
@@ -93,7 +93,7 @@ export function genMount(mountElementId: string) {
93
93
  // 避免多个子应用出现在同一主应用时出现 mount 冲突
94
94
  rootElement:
95
95
  props.container?.querySelector(`#${mountElementId}`) ||
96
- mountElementId,
96
+ document.getElementById(mountElementId),
97
97
 
98
98
  basename: props.base,
99
99
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.21",
3
+ "version": "4.0.22",
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",
@@ -27,7 +27,7 @@
27
27
  "@ant-design/antd-theme-variable": "^1.0.0",
28
28
  "@ant-design/icons": "^4.7.0",
29
29
  "@ant-design/pro-components": "^2.0.1",
30
- "@umijs/bundler-utils": "4.0.21",
30
+ "@umijs/bundler-utils": "4.0.22",
31
31
  "antd-dayjs-webpack-plugin": "^1.0.6",
32
32
  "axios": "^0.27.2",
33
33
  "babel-plugin-import": "^1.13.5",
@@ -46,7 +46,7 @@
46
46
  "warning": "^4.0.3"
47
47
  },
48
48
  "devDependencies": {
49
- "umi": "4.0.21"
49
+ "umi": "4.0.22"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"