-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
bunlde size too large #325
Comments
umi.js can work on vue? |
有没有某个工具检测项目中哪些地方运用到了某些组件,然后按需引入,而不必手动按需引入 |
@zhe-he 我自己写了个简单的小工具,可以实现自动获取组件是引入的组件,然后自己可以根据获取的使用组件列表,来书写按需注入代码。项目在这里:https://github.com/yugasun/auto-detect-component |
有好的解决方案了么?打包后的文件太大了,Icon的svg图标占了400多kb |
仔细查看了 antd vue 的相关源码,我觉得把 moment 替换成 2kb 大小的 dayjs 是一个可行的优化。代码层面基本没有太多的改变,打包体积能把 moment 的 100kb 缩减成 10 kb 以内。 如果 @tangjinzhou 有兴趣的话 我可以提供一些帮助 谢谢 ⏰ Day.js 2KB immutable date library alternative to Moment.js with the same modern API |
@xxyuk 非常感谢你的建议! 另外,可以通过 webpack 进行 moment 优化,代码体积还在在可接受范围内的 |
在 vuecli4 中使用 icon 按需加载时,出现找不到依赖的问题。在vuecli2.x没这个问题
vue.config.js
src/utils/antdIcon.js
|
Thank you, I tried this method, but there is still an error。 package.json
vue.config.js
|
@lework I have encounter the same problem, I found that the from path like you can have a try. this problem maybe happened in you file : src/utils/antdIcon.js
find your own @ant-design path. |
there is a problem,the button component or message component also use the icon,how to solve it |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
For bunlde size too large, you can optimize from the following three aspects:
More discussion about optimizing Icon
The text was updated successfully, but these errors were encountered: