javascript - @蚂蚁设计。为什么所有图标都添加到捆绑包中?
问题描述
我不明白为什么所有图标都在捆绑包中。即使我只使用“antd”中的按钮
import { Button } from 'antd';
- @ant-design/icons-svg/es/asn - 740kb
- @ant-design/icons/es/icons - 470kb
如何解决这个问题?
module.exports = {
presets: ['@babel/preset-react', '@babel/preset-env'],
plugins: [
[
'import',
{
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
},
'antd',
],
],
};
解决方案
推荐阅读
- python - 在 python 烧瓶中处理 HTTPS 发布请求
- javascript - React Admin - 分页不起作用(未捕获的类型错误:我不是函数)
- python - 如何使用python检查列表中存在的元素组合
- r - 拆分复杂的 json 编码字符串
- jquery - DataTables 按钮和搜索框自定义位置
- sql - 从另一个视图调用 View 是个好主意吗?
- git - Mac Cron 作业失败:Sh 脚本手动运行良好,无法在 crontab 中获取 git origin
- c++ - 我只是运行简单的 c++ 程序来检查我的 mingW 是否正常工作,但我遇到了这个错误。有人可以帮我解决吗?
- javascript - 在react中的选项卡之间切换后useRef当前值的重复值
- php - Laravel 8 - 使用 AuthCheck 中间件,只是试图检查会话中有用户名,但它给出了一个错误错误描述如下