umijs / plugins

🍣 The one-stop shop for official Umi plugins and presets.
347 stars 239 forks source link

使用@ant-design/pro-* 编译了超多的var变量 #961

Closed Atw-Lee closed 8 months ago

Atw-Lee commented 8 months ago

Umi Max

// pck.json

  "dependencies": {
    "@ant-design/pro-table": "^2.80.4",
    "@umijs/max": "^4.0.89",
    "antd": "^4"
  },

// .umirc.ts

import { defineConfig } from '@umijs/max';

export default defineConfig({
  // antd: {},
  access: {},
  model: {},
  initialState: {},
  request: {},
  // layout: {
  //   title: '@umijs/max',
  // },
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      name: '首页',
      path: '/home',
      component: './Home',
    },
    {
      name: '权限演示',
      path: '/access',
      component: './Access',
    },
  ],
  theme: {
    'root-entry-name': 'variable',
  },
  npmClient: 'pnpm',
  // analyze: {
  //   analyzerPort: 8888,
  //   openAnalyzer: true,
  // },
});

// home/index

import { EditableProTable } from '@ant-design/pro-table';
import './index.less';
import { Button } from 'antd';

const HomePage: React.FC = () => {
  return (
    <div className="container">
      <Button type="primary">123</Button>
      <EditableProTable />
    </div>
  );
};

export default HomePage;

结果: 生成了超多的var变量 333

期望: 只想要一个

PS:当我关闭root-entry-name后可以,但是@ant-design/pro-*会覆盖我的var动态主题 123

xiaohuoni commented 8 months ago

这个库是 umi@3 的插件,去 umi 主仓库提