umi 引入 ant.design全家桶时icons无法配置按需加载造成单包超过3M

Created on 3 Jun 2020  ·  6Comments  ·  Source: umijs/umi

What happens?

umi3.0 ant design 4.0
通过build分析发现icons全部引入造成包过大

Mini Showcase Repository(REQUIRED)

Provide a mini GitHub repository which can reproduce the issue. Use yarn create @umijs/umi-app then upload to your GitHub

How To Reproduce

Steps to reproduce the behavior: 1. 2.

Expected behavior 1. 2.

Context

  • Umi Version: ^3.1.2
  • Node Version: v12.16.1
  • Platform: mac os

Most helpful comment

我也遇到这个问题了。
删除了每个页面的引用,最后都删除@ant-design/icons了,发现还是被全量引入了。
真是想骂人了。

All 6 comments

的确如此,icon还是全量引入的,似乎目前还没找到好的解决方案

我也遇到这个问题了。
删除了每个页面的引用,最后都删除@ant-design/icons了,发现还是被全量引入了。
真是想骂人了。

myantdpro.zip
这是可复现的源码。

@sorrycc @jrschumacher 大佬们能帮忙看看吗

开启 locale: { antd: true } 就会全量打包icon

开启 locale: { antd: true } 就会全量打包icon

设置成false并没有解决

Was this page helpful?
0 / 5 - 0 ratings