New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TreeShaking 表现问题 #3355
Comments
标记一下 |
疑惑: antd 按需引入无效?引入Button的单页demoimport { Button } from 'antd';
export default () => (
<div>
<Button>Index Page</Button>
</div>
); pro项目的分析看起来两个包引入的大小是一样的。 |
看一下 moment,只用了 Button 是不应该加载 moment 的。另外 antd 内部改了依赖逻辑,把 LocaleProvider 抽出来了。要用旧版的测试一下:https://github.com/ant-design/ant-design/blob/master/components/config-provider/context.tsx ref: |
更新了一下,上面的配图。 |
这里 preset 的 modules 设置成了 commonjs,或许和 webpack 文档 中提到的第二点矛盾? |
只用Button,依然会把 moment 给打包进去 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
有任何进展? |
创建一个页面如下:
修改
antd/es/config-provider/index.js
为:其中
locale-provider
代码没有被引用到,但是没有被 shaking。The text was updated successfully, but these errors were encountered: