用 JS 摇树测试它create-react-app@3.0.1不起作用。
重现步骤:
- 创建新应用
create-react-app treeshakeTest cd treeshakeTestnpm inpm i --save antd- 在顶部和
返回的某处
src/App.js添加import Button from 'antd/es/button'<Button type="primary">Button</Button>
它似乎是 antd 的一个已知问题(图标是导入的)。lib 的 V4 将解决此问题,直到使用https://github.com/Beven91/webpack-ant-icon-loader拆分图标块解决了该问题。