@umijs/plugins 4.6.79 → 4.6.81

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.
Files changed (2) hide show
  1. package/dist/layout.js +4 -0
  2. package/package.json +3 -3
package/dist/layout.js CHANGED
@@ -393,6 +393,9 @@ ${icons.map((icon) => {
393
393
  export default { ${icons.join(", ")} };
394
394
  `
395
395
  });
396
+ const routeIcons = Object.values(api.appData.routes || {}).filter(
397
+ (route) => typeof route.icon === "string" && route.icon.includes(":")
398
+ ).map((route) => route.icon);
396
399
  const isIconsFeatureEnable = api.isPluginEnable("icons");
397
400
  api.writeTmpFile({
398
401
  path: "runtime.tsx",
@@ -400,6 +403,7 @@ export default { ${icons.join(", ")} };
400
403
  import React from 'react';
401
404
  import icons from './icons';
402
405
  ${isIconsFeatureEnable ? `import { Icon, getIconComponent } from '@umijs/max';` : ""}
406
+ ${isIconsFeatureEnable && routeIcons.length ? routeIcons.map((icon) => `<Icon icon="${icon}" />;`).join("\n") : ""}
403
407
 
404
408
  function formatIcon(name: string) {
405
409
  return name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.6.79",
3
+ "version": "4.6.81",
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",
@@ -47,12 +47,12 @@
47
47
  "styled-components": "6.1.1",
48
48
  "tslib": "^2",
49
49
  "warning": "^4.0.3",
50
- "@umijs/bundler-utils": "4.6.79",
50
+ "@umijs/bundler-utils": "4.6.81",
51
51
  "@umijs/valtio": "1.0.4"
52
52
  },
53
53
  "devDependencies": {
54
54
  "antd": "^4.24.1",
55
- "umi": "4.6.79"
55
+ "umi": "4.6.81"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"